
// this is autogenerated file, do not edit it.
#include "ficus/ficus.h"

struct _fx_Nt6option1N10Ast__typ_t_data_t;

static void _fx_free_Nt6option1N10Ast__typ_t(struct _fx_Nt6option1N10Ast__typ_t_data_t** dst);

struct _fx_N20LexerUtils__stream_t_data_t;

static void _fx_free_N20LexerUtils__stream_t(struct _fx_N20LexerUtils__stream_t_data_t** dst);

struct _fx_Nt6option1N10Ast__exp_t_data_t;

static void _fx_free_Nt6option1N10Ast__exp_t(struct _fx_Nt6option1N10Ast__exp_t_data_t** dst);

struct _fx_Nt10Hashset__t1S_data_t;

static void _fx_free_Nt10Hashset__t1S(struct _fx_Nt10Hashset__t1S_data_t** dst);

struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t;

static void _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t** dst);

struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t;

static void _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t** dst);

struct _fx_N10Ast__typ_t_data_t;

static void _fx_free_N10Ast__typ_t(struct _fx_N10Ast__typ_t_data_t** dst);

struct _fx_N13Ast__binary_t_data_t;

static void _fx_free_N13Ast__binary_t(struct _fx_N13Ast__binary_t_data_t** dst);

struct _fx_N10Ast__exp_t_data_t;

static void _fx_free_N10Ast__exp_t(struct _fx_N10Ast__exp_t_data_t** dst);

struct _fx_N10Ast__pat_t_data_t;

static void _fx_free_N10Ast__pat_t(struct _fx_N10Ast__pat_t_data_t** dst);

struct _fx_N16Ast__env_entry_t_data_t;

static void _fx_free_N16Ast__env_entry_t(struct _fx_N16Ast__env_entry_t_data_t** dst);

struct _fx_N16Ast__defmodule_t_data_t;

static void _fx_free_N16Ast__defmodule_t(struct _fx_N16Ast__defmodule_t_data_t** dst);

struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t;

static void _fx_free_Nt10Hashmap__t2SN15Parser__ppval_t(struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t** dst);

typedef struct _fx_Nt6option1N10Ast__typ_t_data_t {
   int_ rc;
   union {
      struct _fx_N10Ast__typ_t_data_t* Some;
   } u;
} _fx_Nt6option1N10Ast__typ_t_data_t, *_fx_Nt6option1N10Ast__typ_t;

typedef struct _fx_LS_data_t {
   int_ rc;
   struct _fx_LS_data_t* tl;
   fx_str_t hd;
} _fx_LS_data_t, *_fx_LS;

typedef struct _fx_N17Options__optval_t {
   int tag;
   union {
      bool OptBool;
      int_ OptInt;
      fx_str_t OptString;
   } u;
} _fx_N17Options__optval_t;

typedef struct _fx_T2SN17Options__optval_t {
   fx_str_t t0;
   struct _fx_N17Options__optval_t t1;
} _fx_T2SN17Options__optval_t;

typedef struct _fx_LT2SN17Options__optval_t_data_t {
   int_ rc;
   struct _fx_LT2SN17Options__optval_t_data_t* tl;
   struct _fx_T2SN17Options__optval_t hd;
} _fx_LT2SN17Options__optval_t_data_t, *_fx_LT2SN17Options__optval_t;

typedef struct _fx_R18Options__options_t {
   struct _fx_LS_data_t* app_args;
   fx_str_t app_filename;
   bool arch64;
   bool force_rebuild;
   fx_str_t build_dir;
   fx_str_t build_rootdir;
   fx_str_t cflags;
   fx_str_t clibs;
   bool compile_by_cpp;
   fx_str_t filename;
   bool gen_c;
   struct _fx_LS_data_t* include_path;
   bool debug;
   struct _fx_LT2SN17Options__optval_t_data_t* defines;
   int_ optim_iters;
   int_ inline_thresh;
   bool enable_openmp;
   bool relax;
   bool use_preamble;
   bool make_app;
   int_ optimize_level;
   fx_str_t output_name;
   bool print_ast0;
   bool print_ast;
   bool print_k0;
   bool print_k;
   bool print_tokens;
   bool run_app;
   bool verbose;
   bool W_unused;
} _fx_R18Options__options_t;

typedef struct _fx_Ta2i {
   int_ t0;
   int_ t1;
} _fx_Ta2i;

typedef struct _fx_T2Ta2iS {
   struct _fx_Ta2i t0;
   fx_str_t t1;
} _fx_T2Ta2iS;

typedef struct _fx_T4SiiS {
   fx_str_t t0;
   int_ t1;
   int_ t2;
   fx_str_t t3;
} _fx_T4SiiS;

typedef struct _fx_N20LexerUtils__stream_t_data_t {
   int_ rc;
   union {
      struct _fx_T4SiiS stream_t;
   } u;
} _fx_N20LexerUtils__stream_t_data_t, *_fx_N20LexerUtils__stream_t;

typedef struct _fx_R9Ast__id_t {
   int_ m;
   int_ i;
   int_ j;
} _fx_R9Ast__id_t;

typedef struct _fx_R10Ast__loc_t {
   int_ m_idx;
   int_ line0;
   int_ col0;
   int_ line1;
   int_ col1;
} _fx_R10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_ti {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
} _fx_T2R9Ast__id_ti;

typedef struct _fx_T2Bi {
   bool t0;
   int_ t1;
} _fx_T2Bi;

typedef struct _fx_N12Ast__scope_t {
   int tag;
   union {
      int_ ScBlock;
      struct _fx_T2Bi ScLoop;
      int_ ScFold;
      int_ ScArrMap;
      int_ ScMap;
      int_ ScTry;
      struct _fx_R9Ast__id_t ScFun;
      struct _fx_R9Ast__id_t ScClass;
      struct _fx_R9Ast__id_t ScInterface;
      int_ ScModule;
   } u;
} _fx_N12Ast__scope_t;

typedef struct _fx_LN12Ast__scope_t_data_t {
   int_ rc;
   struct _fx_LN12Ast__scope_t_data_t* tl;
   struct _fx_N12Ast__scope_t hd;
} _fx_LN12Ast__scope_t_data_t, *_fx_LN12Ast__scope_t;

typedef struct _fx_R16Ast__val_flags_t {
   bool val_flag_arg;
   bool val_flag_mutable;
   bool val_flag_temp;
   bool val_flag_tempref;
   bool val_flag_private;
   bool val_flag_subarray;
   bool val_flag_instance;
   struct _fx_T2R9Ast__id_ti val_flag_method;
   int_ val_flag_ctor;
   struct _fx_LN12Ast__scope_t_data_t* val_flag_global;
} _fx_R16Ast__val_flags_t;

typedef struct _fx_N17Ast__fun_constr_t {
   int tag;
   union {
      int_ CtorVariant;
      struct _fx_R9Ast__id_t CtorFP;
      struct _fx_R9Ast__id_t CtorExn;
   } u;
} _fx_N17Ast__fun_constr_t;

typedef struct _fx_R16Ast__fun_flags_t {
   int_ fun_flag_pure;
   bool fun_flag_ccode;
   bool fun_flag_have_keywords;
   bool fun_flag_inline;
   bool fun_flag_nothrow;
   bool fun_flag_really_nothrow;
   bool fun_flag_private;
   struct _fx_N17Ast__fun_constr_t fun_flag_ctor;
   struct _fx_R9Ast__id_t fun_flag_method_of;
   bool fun_flag_uses_fv;
   bool fun_flag_recursive;
   bool fun_flag_instance;
} _fx_R16Ast__fun_flags_t;

typedef struct _fx_Ta2R9Ast__id_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_R9Ast__id_t t1;
} _fx_Ta2R9Ast__id_t;

typedef struct _fx_LR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LR9Ast__id_t_data_t* tl;
   struct _fx_R9Ast__id_t hd;
} _fx_LR9Ast__id_t_data_t, *_fx_LR9Ast__id_t;

typedef struct _fx_R16Ast__var_flags_t {
   int_ var_flag_class_from;
   bool var_flag_record;
   bool var_flag_recursive;
   bool var_flag_have_tag;
   bool var_flag_have_mutable;
   bool var_flag_opt;
   bool var_flag_instance;
} _fx_R16Ast__var_flags_t;

typedef struct _fx_Nt6option1R9Ast__id_t {
   int tag;
   union {
      struct _fx_R9Ast__id_t Some;
   } u;
} _fx_Nt6option1R9Ast__id_t;

typedef struct _fx_Nt6option1N10Ast__exp_t_data_t {
   int_ rc;
   union {
      struct _fx_N10Ast__exp_t_data_t* Some;
   } u;
} _fx_Nt6option1N10Ast__exp_t_data_t, *_fx_Nt6option1N10Ast__exp_t;

typedef struct _fx_Rt24Hashset__hashset_entry_t1S {
   uint64_t hv;
   fx_str_t key;
} _fx_Rt24Hashset__hashset_entry_t1S;

typedef struct _fx_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S {
   struct _fx_Rt24Hashset__hashset_entry_t1S t0;
   int_ t1;
   int_ t2;
   int_ t3;
   fx_arr_t t4;
   fx_arr_t t5;
} _fx_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S;

typedef struct _fx_Nt10Hashset__t1S_data_t {
   int_ rc;
   union {
      struct _fx_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S t;
   } u;
} _fx_Nt10Hashset__t1S_data_t, *_fx_Nt10Hashset__t1S;

typedef struct _fx_R13Ast__defval_t {
   struct _fx_R9Ast__id_t dv_name;
   struct _fx_N10Ast__typ_t_data_t* dv_typ;
   struct _fx_R16Ast__val_flags_t dv_flags;
   struct _fx_LN12Ast__scope_t_data_t* dv_scope;
   struct _fx_R10Ast__loc_t dv_loc;
} _fx_R13Ast__defval_t;

typedef struct _fx_FPi2R9Ast__id_tR9Ast__id_t {
   int (*fp)(struct _fx_R9Ast__id_t*, struct _fx_R9Ast__id_t*, int_*, void*);
   fx_fcv_t* fcv;
} _fx_FPi2R9Ast__id_tR9Ast__id_t;

typedef struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t {
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* root;
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t cmp;
} _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t;

typedef struct _fx_LN10Ast__pat_t_data_t {
   int_ rc;
   struct _fx_LN10Ast__pat_t_data_t* tl;
   struct _fx_N10Ast__pat_t_data_t* hd;
} _fx_LN10Ast__pat_t_data_t, *_fx_LN10Ast__pat_t;

typedef struct _fx_rLR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LR9Ast__id_t_data_t* data;
} _fx_rLR9Ast__id_t_data_t, *_fx_rLR9Ast__id_t;

typedef struct _fx_R13Ast__deffun_t {
   struct _fx_R9Ast__id_t df_name;
   struct _fx_LR9Ast__id_t_data_t* df_templ_args;
   struct _fx_LN10Ast__pat_t_data_t* df_args;
   struct _fx_N10Ast__typ_t_data_t* df_typ;
   struct _fx_N10Ast__exp_t_data_t* df_body;
   struct _fx_R16Ast__fun_flags_t df_flags;
   struct _fx_LN12Ast__scope_t_data_t* df_scope;
   struct _fx_R10Ast__loc_t df_loc;
   struct _fx_rLR9Ast__id_t_data_t* df_templ_inst;
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t df_env;
} _fx_R13Ast__deffun_t;

typedef struct _fx_rR13Ast__deffun_t_data_t {
   int_ rc;
   struct _fx_R13Ast__deffun_t data;
} _fx_rR13Ast__deffun_t_data_t, *_fx_rR13Ast__deffun_t;

typedef struct _fx_R13Ast__defexn_t {
   struct _fx_R9Ast__id_t dexn_name;
   struct _fx_N10Ast__typ_t_data_t* dexn_typ;
   struct _fx_LN12Ast__scope_t_data_t* dexn_scope;
   struct _fx_R10Ast__loc_t dexn_loc;
} _fx_R13Ast__defexn_t;

typedef struct _fx_rR13Ast__defexn_t_data_t {
   int_ rc;
   struct _fx_R13Ast__defexn_t data;
} _fx_rR13Ast__defexn_t_data_t, *_fx_rR13Ast__defexn_t;

typedef struct _fx_R13Ast__deftyp_t {
   struct _fx_R9Ast__id_t dt_name;
   struct _fx_LR9Ast__id_t_data_t* dt_templ_args;
   struct _fx_N10Ast__typ_t_data_t* dt_typ;
   bool dt_finalized;
   struct _fx_LN12Ast__scope_t_data_t* dt_scope;
   struct _fx_R10Ast__loc_t dt_loc;
} _fx_R13Ast__deftyp_t;

typedef struct _fx_rR13Ast__deftyp_t_data_t {
   int_ rc;
   struct _fx_R13Ast__deftyp_t data;
} _fx_rR13Ast__deftyp_t_data_t, *_fx_rR13Ast__deftyp_t;

typedef struct _fx_T2R9Ast__id_tN10Ast__typ_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2R9Ast__id_tN10Ast__typ_t;

typedef struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN10Ast__typ_t hd;
} _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t, *_fx_LT2R9Ast__id_tN10Ast__typ_t;

typedef struct _fx_LTa2R9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LTa2R9Ast__id_t_data_t* tl;
   struct _fx_Ta2R9Ast__id_t hd;
} _fx_LTa2R9Ast__id_t_data_t, *_fx_LTa2R9Ast__id_t;

typedef struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LTa2R9Ast__id_t_data_t* t1;
} _fx_T2R9Ast__id_tLTa2R9Ast__id_t;

typedef struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* tl;
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t hd;
} _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t, *_fx_LT2R9Ast__id_tLTa2R9Ast__id_t;

typedef struct _fx_R17Ast__defvariant_t {
   struct _fx_R9Ast__id_t dvar_name;
   struct _fx_LR9Ast__id_t_data_t* dvar_templ_args;
   struct _fx_N10Ast__typ_t_data_t* dvar_alias;
   struct _fx_R16Ast__var_flags_t dvar_flags;
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* dvar_cases;
   struct _fx_LR9Ast__id_t_data_t* dvar_ctors;
   struct _fx_rLR9Ast__id_t_data_t* dvar_templ_inst;
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* dvar_ifaces;
   struct _fx_LN12Ast__scope_t_data_t* dvar_scope;
   struct _fx_R10Ast__loc_t dvar_loc;
} _fx_R17Ast__defvariant_t;

typedef struct _fx_rR17Ast__defvariant_t_data_t {
   int_ rc;
   struct _fx_R17Ast__defvariant_t data;
} _fx_rR17Ast__defvariant_t_data_t, *_fx_rR17Ast__defvariant_t;

typedef struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_R16Ast__fun_flags_t t2;
} _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t;

typedef struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t {
   int_ rc;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* tl;
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t hd;
} _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t, *_fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t;

typedef struct _fx_R19Ast__definterface_t {
   struct _fx_R9Ast__id_t di_name;
   struct _fx_R9Ast__id_t di_base;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* di_new_methods;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* di_all_methods;
   struct _fx_LN12Ast__scope_t_data_t* di_scope;
   struct _fx_R10Ast__loc_t di_loc;
} _fx_R19Ast__definterface_t;

typedef struct _fx_rR19Ast__definterface_t_data_t {
   int_ rc;
   struct _fx_R19Ast__definterface_t data;
} _fx_rR19Ast__definterface_t_data_t, *_fx_rR19Ast__definterface_t;

typedef struct _fx_N14Ast__id_info_t {
   int tag;
   union {
      struct _fx_R13Ast__defval_t IdDVal;
      struct _fx_rR13Ast__deffun_t_data_t* IdFun;
      struct _fx_rR13Ast__defexn_t_data_t* IdExn;
      struct _fx_rR13Ast__deftyp_t_data_t* IdTyp;
      struct _fx_rR17Ast__defvariant_t_data_t* IdVariant;
      struct _fx_rR19Ast__definterface_t_data_t* IdInterface;
      int_ IdModule;
   } u;
} _fx_N14Ast__id_info_t;

typedef struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t {
   int_ t0;
   fx_arr_t t1;
   struct _fx_N14Ast__id_info_t t2;
} _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t;

typedef struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t {
   int_ rc;
   union {
      struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t t;
   } u;
} _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t, *_fx_Nt9Dynvec__t1N14Ast__id_info_t;

typedef struct _fx_N12Map__color_t {
   int tag;
} _fx_N12Map__color_t;

typedef struct _fx_LN16Ast__env_entry_t_data_t {
   int_ rc;
   struct _fx_LN16Ast__env_entry_t_data_t* tl;
   struct _fx_N16Ast__env_entry_t_data_t* hd;
} _fx_LN16Ast__env_entry_t_data_t, *_fx_LN16Ast__env_entry_t;

typedef struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t {
   struct _fx_N12Map__color_t t0;
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t1;
   struct _fx_R9Ast__id_t t2;
   struct _fx_LN16Ast__env_entry_t_data_t* t3;
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t4;
} _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t;

typedef struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t {
   int_ rc;
   union {
      struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t
         Node;
   } u;
} _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t, *_fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t;

typedef struct _fx_T2R10Ast__loc_tS {
   struct _fx_R10Ast__loc_t t0;
   fx_str_t t1;
} _fx_T2R10Ast__loc_tS;

typedef struct _fx_T2il {
   int_ t0;
   int64_t t1;
} _fx_T2il;

typedef struct _fx_T2iq {
   int_ t0;
   uint64_t t1;
} _fx_T2iq;

typedef struct _fx_T2id {
   int_ t0;
   double t1;
} _fx_T2id;

typedef struct _fx_N10Ast__lit_t {
   int tag;
   union {
      int64_t LitInt;
      struct _fx_T2il LitSInt;
      struct _fx_T2iq LitUInt;
      struct _fx_T2id LitFloat;
      fx_str_t LitString;
      char_ LitChar;
      bool LitBool;
   } u;
} _fx_N10Ast__lit_t;

typedef struct _fx_rNt6option1N10Ast__typ_t_data_t {
   int_ rc;
   struct _fx_Nt6option1N10Ast__typ_t_data_t* data;
} _fx_rNt6option1N10Ast__typ_t_data_t, *_fx_rNt6option1N10Ast__typ_t;

typedef struct _fx_LN10Ast__typ_t_data_t {
   int_ rc;
   struct _fx_LN10Ast__typ_t_data_t* tl;
   struct _fx_N10Ast__typ_t_data_t* hd;
} _fx_LN10Ast__typ_t_data_t, *_fx_LN10Ast__typ_t;

typedef struct _fx_T2LN10Ast__typ_tN10Ast__typ_t {
   struct _fx_LN10Ast__typ_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2LN10Ast__typ_tN10Ast__typ_t;

typedef struct _fx_T2iN10Ast__typ_t {
   int_ t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2iN10Ast__typ_t;

typedef struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t {
   struct _fx_R16Ast__val_flags_t t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_N10Ast__typ_t_data_t* t2;
   struct _fx_N10Ast__exp_t_data_t* t3;
} _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t;

typedef struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* tl;
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t hd;
} _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t, *_fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t;

typedef struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB {
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t0;
   bool t1;
} _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB;

typedef struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t {
   int_ rc;
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB data;
} _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t, *_fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB;

typedef struct _fx_T2LN10Ast__typ_tR9Ast__id_t {
   struct _fx_LN10Ast__typ_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
} _fx_T2LN10Ast__typ_tR9Ast__id_t;

typedef struct _fx_N10Ast__typ_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_rNt6option1N10Ast__typ_t_data_t* TypVar;
      struct _fx_Nt6option1N10Ast__typ_t_data_t* TypVarTuple;
      struct _fx_N10Ast__typ_t_data_t* TypVarArray;
      int_ TypSInt;
      int_ TypUInt;
      int_ TypFloat;
      struct _fx_T2LN10Ast__typ_tN10Ast__typ_t TypFun;
      struct _fx_N10Ast__typ_t_data_t* TypList;
      struct _fx_N10Ast__typ_t_data_t* TypVector;
      struct _fx_LN10Ast__typ_t_data_t* TypTuple;
      struct _fx_N10Ast__typ_t_data_t* TypRef;
      struct _fx_T2iN10Ast__typ_t TypArray;
      struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t* TypRecord;
      struct _fx_T2LN10Ast__typ_tR9Ast__id_t TypApp;
   } u;
} _fx_N10Ast__typ_t_data_t, *_fx_N10Ast__typ_t;

typedef struct _fx_N12Ast__cmpop_t {
   int tag;
} _fx_N12Ast__cmpop_t;

typedef struct _fx_N13Ast__binary_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_N12Ast__cmpop_t OpCmp;
      struct _fx_N12Ast__cmpop_t OpDotCmp;
      struct _fx_N13Ast__binary_t_data_t* OpAugBinary;
   } u;
} _fx_N13Ast__binary_t_data_t, *_fx_N13Ast__binary_t;

typedef struct _fx_N12Ast__unary_t {
   int tag;
} _fx_N12Ast__unary_t;

typedef struct _fx_N12Ast__sctyp_t {
   int tag;
} _fx_N12Ast__sctyp_t;

typedef struct _fx_N13Ast__intrin_t {
   int tag;
   union {
      struct _fx_R9Ast__id_t IntrinMath;
      struct _fx_N12Ast__sctyp_t IntrinSaturate;
   } u;
} _fx_N13Ast__intrin_t;

typedef struct _fx_N15Ast__for_make_t {
   int tag;
} _fx_N15Ast__for_make_t;

typedef struct _fx_R16Ast__for_flags_t {
   bool for_flag_parallel;
   struct _fx_N15Ast__for_make_t for_flag_make;
   bool for_flag_unzip;
   bool for_flag_fold;
   bool for_flag_nested;
} _fx_R16Ast__for_flags_t;

typedef struct _fx_N13Ast__border_t {
   int tag;
} _fx_N13Ast__border_t;

typedef struct _fx_N18Ast__interpolate_t {
   int tag;
} _fx_N18Ast__interpolate_t;

typedef struct _fx_T2BR10Ast__loc_t {
   bool t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2BR10Ast__loc_t;

typedef struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t {
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__typ_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__lit_t t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N13Ast__binary_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N12Ast__unary_t t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_LN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LN10Ast__exp_t_data_t* tl;
   struct _fx_N10Ast__exp_t_data_t* hd;
} _fx_LN10Ast__exp_t_data_t, *_fx_LN10Ast__exp_t;

typedef struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N13Ast__intrin_t t0;
   struct _fx_LN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN10Ast__exp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2R9Ast__id_tN10Ast__exp_t;

typedef struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_LN10Ast__exp_t_data_t* t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_LLN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LLN10Ast__exp_t_data_t* tl;
   struct _fx_LN10Ast__exp_t_data_t* hd;
} _fx_LLN10Ast__exp_t_data_t, *_fx_LLN10Ast__exp_t;

typedef struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_LLN10Ast__exp_t_data_t* t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN10Ast__exp_t hd;
} _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t, *_fx_LT2R9Ast__id_tN10Ast__exp_t;

typedef struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N13Ast__border_t t1;
   struct _fx_N18Ast__interpolate_t t2;
   struct _fx_LN10Ast__exp_t_data_t* t3;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t4;
} _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__exp_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__pat_tN10Ast__exp_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2N10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* tl;
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t hd;
} _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t, *_fx_LT2N10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t {
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_R16Ast__for_flags_t t3;
   struct _fx_R10Ast__loc_t t4;
} _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t;

typedef struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t {
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
} _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t;

typedef struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t {
   int_ rc;
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* tl;
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t hd;
} _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t, *_fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t;

typedef struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R16Ast__for_flags_t t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t {
   fx_str_t t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2ST2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t {
   fx_str_t t0;
   fx_str_t t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3SST2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R16Ast__val_flags_t t2;
   struct _fx_R10Ast__loc_t t3;
} _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t;

typedef struct _fx_T2iR9Ast__id_t {
   int_ t0;
   struct _fx_R9Ast__id_t t1;
} _fx_T2iR9Ast__id_t;

typedef struct _fx_LT2iR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT2iR9Ast__id_t_data_t* tl;
   struct _fx_T2iR9Ast__id_t hd;
} _fx_LT2iR9Ast__id_t_data_t, *_fx_LT2iR9Ast__id_t;

typedef struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t {
   struct _fx_LT2iR9Ast__id_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LT2iR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T3iLR9Ast__id_tR10Ast__loc_t {
   int_ t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3iLR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T2LSR10Ast__loc_t {
   struct _fx_LS_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LSR10Ast__loc_t;

typedef struct _fx_N10Ast__exp_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R10Ast__loc_t ExpNop;
      struct _fx_T2BR10Ast__loc_t ExpBreak;
      struct _fx_R10Ast__loc_t ExpContinue;
      struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t ExpReturn;
      struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpRange;
      struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t ExpLit;
      struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t ExpIdent;
      struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpBinary;
      struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpUnary;
      struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpIntrin;
      struct _fx_T2R9Ast__id_tN10Ast__exp_t ExpSync;
      struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpSeq;
      struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkTuple;
      struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkArray;
      struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkVector;
      struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkRecord;
      struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpUpdateRecord;
      struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpCall;
      struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpAt;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t ExpAssign;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMem;
      struct _fx_T2N10Ast__exp_tR10Ast__loc_t ExpThrow;
      struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpIf;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t ExpWhile;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t ExpDoWhile;
      struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t ExpFor;
      struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t
         ExpMap;
      struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpTryCatch;
      struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMatch;
      struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t ExpCast;
      struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t ExpTyped;
      struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t ExpCCode;
      struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t ExpData;
      struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t DefVal;
      struct _fx_rR13Ast__deffun_t_data_t* DefFun;
      struct _fx_rR13Ast__defexn_t_data_t* DefExn;
      struct _fx_rR13Ast__deftyp_t_data_t* DefTyp;
      struct _fx_rR17Ast__defvariant_t_data_t* DefVariant;
      struct _fx_rR19Ast__definterface_t_data_t* DefInterface;
      struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t DirImport;
      struct _fx_T3iLR9Ast__id_tR10Ast__loc_t DirImportFrom;
      struct _fx_T2LSR10Ast__loc_t DirPragma;
   } u;
} _fx_N10Ast__exp_t_data_t, *_fx_N10Ast__exp_t;

typedef struct _fx_T2N10Ast__lit_tR10Ast__loc_t {
   struct _fx_N10Ast__lit_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__lit_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2R9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T2LN10Ast__pat_tR10Ast__loc_t {
   struct _fx_LN10Ast__pat_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LN10Ast__pat_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN10Ast__pat_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
} _fx_T2R9Ast__id_tN10Ast__pat_t;

typedef struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN10Ast__pat_t hd;
} _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t, *_fx_LT2R9Ast__id_tN10Ast__pat_t;

typedef struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t {
   struct _fx_Nt6option1R9Ast__id_t t0;
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__pat_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_N10Ast__pat_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R10Ast__loc_t PatAny;
      struct _fx_T2N10Ast__lit_tR10Ast__loc_t PatLit;
      struct _fx_T2R9Ast__id_tR10Ast__loc_t PatIdent;
      struct _fx_T2LN10Ast__pat_tR10Ast__loc_t PatTuple;
      struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t PatVariant;
      struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t PatRecord;
      struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t PatCons;
      struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t PatAs;
      struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t PatTyped;
      struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t PatWhen;
      struct _fx_T2LN10Ast__pat_tR10Ast__loc_t PatAlt;
      struct _fx_T2N10Ast__pat_tR10Ast__loc_t PatRef;
   } u;
} _fx_N10Ast__pat_t_data_t, *_fx_N10Ast__pat_t;

typedef struct _fx_N16Ast__env_entry_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R9Ast__id_t EnvId;
      struct _fx_N10Ast__typ_t_data_t* EnvTyp;
   } u;
} _fx_N16Ast__env_entry_t_data_t, *_fx_N16Ast__env_entry_t;

typedef struct _fx_Li_data_t {
   int_ rc;
   struct _fx_Li_data_t* tl;
   int_ hd;
} _fx_Li_data_t, *_fx_Li;

typedef struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t {
   struct _fx_R9Ast__id_t t0;
   fx_str_t t1;
   int_ t2;
   bool t3;
   struct _fx_LN10Ast__exp_t_data_t* t4;
   struct _fx_Li_data_t* t5;
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t t6;
   bool t7;
   int_ t8;
   struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t* t9;
} _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t;

typedef struct _fx_N16Ast__defmodule_t_data_t {
   int_ rc;
   union {
      struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t
         defmodule_t;
   } u;
} _fx_N16Ast__defmodule_t_data_t, *_fx_N16Ast__defmodule_t;

typedef struct _fx_LR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LR10Ast__loc_t_data_t* tl;
   struct _fx_R10Ast__loc_t hd;
} _fx_LR10Ast__loc_t_data_t, *_fx_LR10Ast__loc_t;

typedef struct _fx_T2BS {
   bool t0;
   fx_str_t t1;
} _fx_T2BS;

typedef struct _fx_N14Lexer__token_t {
   int tag;
   union {
      struct _fx_N10Ast__lit_t LITERAL;
      struct _fx_T2BS IDENT;
      fx_str_t TYVAR;
      fx_str_t DATA;
      bool FOR;
      bool IMPORT;
      bool REF;
      bool RETURN;
      bool WHILE;
      bool LPAREN;
      bool LSQUARE;
      bool BACKSLASH;
      bool MINUS;
      bool PLUS;
      bool STAR;
      bool DOT_PLUS;
      bool DOT_MINUS;
      struct _fx_N13Ast__binary_t_data_t* AUG_BINOP;
      struct _fx_N12Ast__cmpop_t CMP;
      struct _fx_N12Ast__cmpop_t DOT_CMP;
      fx_str_t RESERVED;
   } u;
} _fx_N14Lexer__token_t;

typedef struct _fx_T2N14Lexer__token_tTa2i {
   struct _fx_N14Lexer__token_t t0;
   struct _fx_Ta2i t1;
} _fx_T2N14Lexer__token_tTa2i;

typedef struct _fx_LT2N14Lexer__token_tTa2i_data_t {
   int_ rc;
   struct _fx_LT2N14Lexer__token_tTa2i_data_t* tl;
   struct _fx_T2N14Lexer__token_tTa2i hd;
} _fx_LT2N14Lexer__token_tTa2i_data_t, *_fx_LT2N14Lexer__token_tTa2i;

typedef struct _fx_LN14Lexer__token_t_data_t {
   int_ rc;
   struct _fx_LN14Lexer__token_t_data_t* tl;
   struct _fx_N14Lexer__token_t hd;
} _fx_LN14Lexer__token_t_data_t, *_fx_LN14Lexer__token_t;

typedef struct _fx_Ta2S {
   fx_str_t t0;
   fx_str_t t1;
} _fx_Ta2S;

typedef struct _fx_FPLT2N14Lexer__token_tTa2i0 {
   int (*fp)(struct _fx_LT2N14Lexer__token_tTa2i_data_t**, void*);
   fx_fcv_t* fcv;
} _fx_FPLT2N14Lexer__token_tTa2i0;

typedef struct _fx_N15Parser__ppval_t {
   int tag;
   union {
      int64_t PP_INT;
      bool PP_BOOL;
      fx_str_t PP_STRING;
   } u;
} _fx_N15Parser__ppval_t;

typedef struct _fx_Nt6option1N15Parser__ppval_t {
   int tag;
   union {
      struct _fx_N15Parser__ppval_t Some;
   } u;
} _fx_Nt6option1N15Parser__ppval_t;

typedef struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t {
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t2;
   struct _fx_R10Ast__loc_t t3;
} _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t* tl;
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t hd;
} _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t, *_fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_LNt6option1N10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LNt6option1N10Ast__exp_t_data_t* tl;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* hd;
} _fx_LNt6option1N10Ast__exp_t_data_t, *_fx_LNt6option1N10Ast__exp_t;

typedef struct _fx_T2N12Ast__cmpop_tR10Ast__loc_t {
   struct _fx_N12Ast__cmpop_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N12Ast__cmpop_tR10Ast__loc_t;

typedef struct _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t {
   struct _fx_T2N12Ast__cmpop_tR10Ast__loc_t t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t;

typedef struct _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t_data_t* tl;
   struct _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t hd;
} _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t_data_t, *_fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t;

typedef struct _fx_T2N14Lexer__token_tR10Ast__loc_t {
   struct _fx_N14Lexer__token_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N14Lexer__token_tR10Ast__loc_t;

typedef struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* tl;
   struct _fx_T2N14Lexer__token_tR10Ast__loc_t hd;
} _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t, *_fx_LT2N14Lexer__token_tR10Ast__loc_t;

typedef struct _fx_N19Parser__ppifstate_t {
   int tag;
   union {
      bool PP_BR_FALSE;
      bool PP_BR_ELSE;
   } u;
} _fx_N19Parser__ppifstate_t;

typedef struct _fx_T2N19Parser__ppifstate_tR10Ast__loc_t {
   struct _fx_N19Parser__ppifstate_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N19Parser__ppifstate_tR10Ast__loc_t;

typedef struct _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t_data_t* tl;
   struct _fx_T2N19Parser__ppifstate_tR10Ast__loc_t hd;
} _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t_data_t, *_fx_LT2N19Parser__ppifstate_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
} _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t* tl;
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t hd;
} _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t, *_fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t {
   struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t* t0;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t* tl;
   struct _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t hd;
} _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t, *_fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t {
   uint64_t hv;
   fx_str_t key;
   struct _fx_N15Parser__ppval_t data;
} _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t;

typedef struct _fx_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t {
   struct _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t t0;
   int_ t1;
   int_ t2;
   int_ t3;
   fx_arr_t t4;
   fx_arr_t t5;
} _fx_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t;

typedef struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t {
   int_ rc;
   union {
      struct _fx_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t t;
   } u;
} _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t, *_fx_Nt10Hashmap__t2SN15Parser__ppval_t;

typedef struct _fx_N15Ast__op_assoc_t {
   int tag;
} _fx_N15Ast__op_assoc_t;

typedef struct _fx_R20Parser__parser_ctx_t {
   int_ m_idx;
   fx_str_t filename;
   struct _fx_Li_data_t* deps;
   struct _fx_LS_data_t* inc_dirs;
   struct _fx_R10Ast__loc_t default_loc;
} _fx_R20Parser__parser_ctx_t;

typedef struct _fx_N17Parser__kw_mode_t {
   int tag;
} _fx_N17Parser__kw_mode_t;

typedef struct _fx_T2LN10Ast__pat_tN10Ast__exp_t {
   struct _fx_LN10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2LN10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_T2LN10Ast__pat_tLN10Ast__exp_t {
   struct _fx_LN10Ast__pat_t_data_t* t0;
   struct _fx_LN10Ast__exp_t_data_t* t1;
} _fx_T2LN10Ast__pat_tLN10Ast__exp_t;

typedef struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t {
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_R16Ast__for_flags_t t2;
   struct _fx_R10Ast__loc_t t3;
} _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t;

typedef struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t_data_t* tl;
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t hd;
} _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t_data_t, *_fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t;

typedef struct _fx_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t {
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t;

typedef struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_R16Ast__for_flags_t t3;
} _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t;

typedef struct _fx_FPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t {
   int (*fp)(
      struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t*, struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t*,
         void*);
   fx_fcv_t* fcv;
} _fx_FPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t;

typedef struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   bool t1;
   struct _fx_LN10Ast__exp_t_data_t* t2;
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* t3;
} _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   fx_str_t t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t;

typedef struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
} _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t;

typedef struct _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t {
   struct _fx_N13Ast__binary_t_data_t* t0;
   int_ t1;
   struct _fx_N15Ast__op_assoc_t t2;
} _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_LN10Ast__exp_t_data_t* t2;
} _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t;

typedef struct _fx_T2N10Ast__exp_tLN10Ast__exp_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LN10Ast__exp_t_data_t* t1;
} _fx_T2N10Ast__exp_tLN10Ast__exp_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LN10Ast__exp_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LNt6option1N10Ast__exp_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LT2iR9Ast__id_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LS_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t;

typedef struct _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t {
   struct _fx_LN10Ast__exp_t_data_t* t0;
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t* t1;
} _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t {
   struct _fx_LN10Ast__exp_t_data_t* t0;
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1;
   struct _fx_N10Ast__pat_t_data_t* t2;
} _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t {
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
} _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tB {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   bool t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tB;

typedef struct _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LN10Ast__pat_t_data_t* t1;
   struct _fx_N10Ast__typ_t_data_t* t2;
   struct _fx_LN10Ast__exp_t_data_t* t3;
   bool t4;
} _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t;

typedef struct _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_R10Ast__loc_t t3;
} _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t_data_t* tl;
   struct _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t hd;
} _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t_data_t, *_fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LN10Ast__pat_t_data_t* t1;
   struct _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t_data_t* t2;
} _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LN10Ast__pat_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_R16Ast__fun_flags_t t3;
} _fx_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LN10Ast__pat_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t;

typedef struct _fx_T2iN15Ast__op_assoc_t {
   int_ t0;
   struct _fx_N15Ast__op_assoc_t t1;
} _fx_T2iN15Ast__op_assoc_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t;

typedef struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   bool t1;
   fx_str_t t2;
   struct _fx_R16Ast__val_flags_t t3;
} _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_ti {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   int_ t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_ti;

typedef struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t;

typedef struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t {
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0;
   struct _fx_N15Parser__ppval_t t1;
} _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t;

typedef struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t {
   int_ rc;
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t* data;
} _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t, *_fx_rNt10Hashmap__t2SN15Parser__ppval_t;

typedef struct {
   int_ rc;
   int_ data;
} _fx_E4Exit_data_t;

typedef struct {
   int_ rc;
   fx_str_t data;
} _fx_E4Fail_data_t;

typedef struct {
   int_ rc;
   struct _fx_T2Ta2iS data;
} _fx_E22LexerUtils__LexerError_data_t;

typedef struct {
   int_ rc;
   struct _fx_T2R10Ast__loc_tS data;
} _fx_E17Ast__CompileError_data_t;

static void _fx_free_Nt6option1N10Ast__typ_t(struct _fx_Nt6option1N10Ast__typ_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_N10Ast__typ_t(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_LS(struct _fx_LS_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LS, fx_free_str);
}

static int _fx_cons_LS(fx_str_t* hd, struct _fx_LS_data_t* tl, bool addref_tl, struct _fx_LS_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LS, fx_copy_str);
}

static void _fx_free_N17Options__optval_t(struct _fx_N17Options__optval_t* dst)
{
   switch (dst->tag) {
   case 3:
      fx_free_str(&dst->u.OptString); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N17Options__optval_t(struct _fx_N17Options__optval_t* src, struct _fx_N17Options__optval_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 3:
      fx_copy_str(&src->u.OptString, &dst->u.OptString); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T2SN17Options__optval_t(struct _fx_T2SN17Options__optval_t* dst)
{
   fx_free_str(&dst->t0);
   _fx_free_N17Options__optval_t(&dst->t1);
}

static void _fx_copy_T2SN17Options__optval_t(struct _fx_T2SN17Options__optval_t* src, struct _fx_T2SN17Options__optval_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   _fx_copy_N17Options__optval_t(&src->t1, &dst->t1);
}

static void _fx_make_T2SN17Options__optval_t(
   fx_str_t* t0,
   struct _fx_N17Options__optval_t* t1,
   struct _fx_T2SN17Options__optval_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   _fx_copy_N17Options__optval_t(t1, &fx_result->t1);
}

static void _fx_free_LT2SN17Options__optval_t(struct _fx_LT2SN17Options__optval_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2SN17Options__optval_t, _fx_free_T2SN17Options__optval_t);
}

static int _fx_cons_LT2SN17Options__optval_t(
   struct _fx_T2SN17Options__optval_t* hd,
   struct _fx_LT2SN17Options__optval_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2SN17Options__optval_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2SN17Options__optval_t, _fx_copy_T2SN17Options__optval_t);
}

static void _fx_free_R18Options__options_t(struct _fx_R18Options__options_t* dst)
{
   _fx_free_LS(&dst->app_args);
   fx_free_str(&dst->app_filename);
   fx_free_str(&dst->build_dir);
   fx_free_str(&dst->build_rootdir);
   fx_free_str(&dst->cflags);
   fx_free_str(&dst->clibs);
   fx_free_str(&dst->filename);
   _fx_free_LS(&dst->include_path);
   _fx_free_LT2SN17Options__optval_t(&dst->defines);
   fx_free_str(&dst->output_name);
}

static void _fx_copy_R18Options__options_t(struct _fx_R18Options__options_t* src, struct _fx_R18Options__options_t* dst)
{
   FX_COPY_PTR(src->app_args, &dst->app_args);
   fx_copy_str(&src->app_filename, &dst->app_filename);
   dst->arch64 = src->arch64;
   dst->force_rebuild = src->force_rebuild;
   fx_copy_str(&src->build_dir, &dst->build_dir);
   fx_copy_str(&src->build_rootdir, &dst->build_rootdir);
   fx_copy_str(&src->cflags, &dst->cflags);
   fx_copy_str(&src->clibs, &dst->clibs);
   dst->compile_by_cpp = src->compile_by_cpp;
   fx_copy_str(&src->filename, &dst->filename);
   dst->gen_c = src->gen_c;
   FX_COPY_PTR(src->include_path, &dst->include_path);
   dst->debug = src->debug;
   FX_COPY_PTR(src->defines, &dst->defines);
   dst->optim_iters = src->optim_iters;
   dst->inline_thresh = src->inline_thresh;
   dst->enable_openmp = src->enable_openmp;
   dst->relax = src->relax;
   dst->use_preamble = src->use_preamble;
   dst->make_app = src->make_app;
   dst->optimize_level = src->optimize_level;
   fx_copy_str(&src->output_name, &dst->output_name);
   dst->print_ast0 = src->print_ast0;
   dst->print_ast = src->print_ast;
   dst->print_k0 = src->print_k0;
   dst->print_k = src->print_k;
   dst->print_tokens = src->print_tokens;
   dst->run_app = src->run_app;
   dst->verbose = src->verbose;
   dst->W_unused = src->W_unused;
}

static void _fx_make_R18Options__options_t(
   struct _fx_LS_data_t* r_app_args,
   fx_str_t* r_app_filename,
   bool r_arch64,
   bool r_force_rebuild,
   fx_str_t* r_build_dir,
   fx_str_t* r_build_rootdir,
   fx_str_t* r_cflags,
   fx_str_t* r_clibs,
   bool r_compile_by_cpp,
   fx_str_t* r_filename,
   bool r_gen_c,
   struct _fx_LS_data_t* r_include_path,
   bool r_debug,
   struct _fx_LT2SN17Options__optval_t_data_t* r_defines,
   int_ r_optim_iters,
   int_ r_inline_thresh,
   bool r_enable_openmp,
   bool r_relax,
   bool r_use_preamble,
   bool r_make_app,
   int_ r_optimize_level,
   fx_str_t* r_output_name,
   bool r_print_ast0,
   bool r_print_ast,
   bool r_print_k0,
   bool r_print_k,
   bool r_print_tokens,
   bool r_run_app,
   bool r_verbose,
   bool r_W_unused,
   struct _fx_R18Options__options_t* fx_result)
{
   FX_COPY_PTR(r_app_args, &fx_result->app_args);
   fx_copy_str(r_app_filename, &fx_result->app_filename);
   fx_result->arch64 = r_arch64;
   fx_result->force_rebuild = r_force_rebuild;
   fx_copy_str(r_build_dir, &fx_result->build_dir);
   fx_copy_str(r_build_rootdir, &fx_result->build_rootdir);
   fx_copy_str(r_cflags, &fx_result->cflags);
   fx_copy_str(r_clibs, &fx_result->clibs);
   fx_result->compile_by_cpp = r_compile_by_cpp;
   fx_copy_str(r_filename, &fx_result->filename);
   fx_result->gen_c = r_gen_c;
   FX_COPY_PTR(r_include_path, &fx_result->include_path);
   fx_result->debug = r_debug;
   FX_COPY_PTR(r_defines, &fx_result->defines);
   fx_result->optim_iters = r_optim_iters;
   fx_result->inline_thresh = r_inline_thresh;
   fx_result->enable_openmp = r_enable_openmp;
   fx_result->relax = r_relax;
   fx_result->use_preamble = r_use_preamble;
   fx_result->make_app = r_make_app;
   fx_result->optimize_level = r_optimize_level;
   fx_copy_str(r_output_name, &fx_result->output_name);
   fx_result->print_ast0 = r_print_ast0;
   fx_result->print_ast = r_print_ast;
   fx_result->print_k0 = r_print_k0;
   fx_result->print_k = r_print_k;
   fx_result->print_tokens = r_print_tokens;
   fx_result->run_app = r_run_app;
   fx_result->verbose = r_verbose;
   fx_result->W_unused = r_W_unused;
}

static void _fx_free_T2Ta2iS(struct _fx_T2Ta2iS* dst)
{
   fx_free_str(&dst->t1);
}

static void _fx_copy_T2Ta2iS(struct _fx_T2Ta2iS* src, struct _fx_T2Ta2iS* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_T2Ta2iS(struct _fx_Ta2i* t0, fx_str_t* t1, struct _fx_T2Ta2iS* fx_result)
{
   fx_result->t0 = *t0;
   fx_copy_str(t1, &fx_result->t1);
}

static void _fx_free_T4SiiS(struct _fx_T4SiiS* dst)
{
   fx_free_str(&dst->t0);
   fx_free_str(&dst->t3);
}

static void _fx_copy_T4SiiS(struct _fx_T4SiiS* src, struct _fx_T4SiiS* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   fx_copy_str(&src->t3, &dst->t3);
}

static void _fx_make_T4SiiS(fx_str_t* t0, int_ t1, int_ t2, fx_str_t* t3, struct _fx_T4SiiS* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   fx_result->t1 = t1;
   fx_result->t2 = t2;
   fx_copy_str(t3, &fx_result->t3);
}

static void _fx_free_N20LexerUtils__stream_t(struct _fx_N20LexerUtils__stream_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T4SiiS(&(*dst)->u.stream_t); fx_free(*dst);
   }
   *dst = 0;
}

static int _fx_cons_LN12Ast__scope_t(
   struct _fx_N12Ast__scope_t* hd,
   struct _fx_LN12Ast__scope_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN12Ast__scope_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN12Ast__scope_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_R16Ast__val_flags_t(struct _fx_R16Ast__val_flags_t* dst)
{
   fx_free_list_simple(&dst->val_flag_global);
}

static void _fx_copy_R16Ast__val_flags_t(struct _fx_R16Ast__val_flags_t* src, struct _fx_R16Ast__val_flags_t* dst)
{
   dst->val_flag_arg = src->val_flag_arg;
   dst->val_flag_mutable = src->val_flag_mutable;
   dst->val_flag_temp = src->val_flag_temp;
   dst->val_flag_tempref = src->val_flag_tempref;
   dst->val_flag_private = src->val_flag_private;
   dst->val_flag_subarray = src->val_flag_subarray;
   dst->val_flag_instance = src->val_flag_instance;
   dst->val_flag_method = src->val_flag_method;
   dst->val_flag_ctor = src->val_flag_ctor;
   FX_COPY_PTR(src->val_flag_global, &dst->val_flag_global);
}

static void _fx_make_R16Ast__val_flags_t(
   bool r_val_flag_arg,
   bool r_val_flag_mutable,
   bool r_val_flag_temp,
   bool r_val_flag_tempref,
   bool r_val_flag_private,
   bool r_val_flag_subarray,
   bool r_val_flag_instance,
   struct _fx_T2R9Ast__id_ti* r_val_flag_method,
   int_ r_val_flag_ctor,
   struct _fx_LN12Ast__scope_t_data_t* r_val_flag_global,
   struct _fx_R16Ast__val_flags_t* fx_result)
{
   fx_result->val_flag_arg = r_val_flag_arg;
   fx_result->val_flag_mutable = r_val_flag_mutable;
   fx_result->val_flag_temp = r_val_flag_temp;
   fx_result->val_flag_tempref = r_val_flag_tempref;
   fx_result->val_flag_private = r_val_flag_private;
   fx_result->val_flag_subarray = r_val_flag_subarray;
   fx_result->val_flag_instance = r_val_flag_instance;
   fx_result->val_flag_method = *r_val_flag_method;
   fx_result->val_flag_ctor = r_val_flag_ctor;
   FX_COPY_PTR(r_val_flag_global, &fx_result->val_flag_global);
}

static int _fx_cons_LR9Ast__id_t(
   struct _fx_R9Ast__id_t* hd,
   struct _fx_LR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LR9Ast__id_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_Nt6option1N10Ast__exp_t(struct _fx_Nt6option1N10Ast__exp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_N10Ast__exp_t(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Rt24Hashset__hashset_entry_t1S(struct _fx_Rt24Hashset__hashset_entry_t1S* dst)
{
   fx_free_str(&dst->key);
}

static void _fx_copy_Rt24Hashset__hashset_entry_t1S(
   struct _fx_Rt24Hashset__hashset_entry_t1S* src,
   struct _fx_Rt24Hashset__hashset_entry_t1S* dst)
{
   dst->hv = src->hv;
   fx_copy_str(&src->key, &dst->key);
}

static void _fx_make_Rt24Hashset__hashset_entry_t1S(
   uint64_t r_hv,
   fx_str_t* r_key,
   struct _fx_Rt24Hashset__hashset_entry_t1S* fx_result)
{
   fx_result->hv = r_hv;
   fx_copy_str(r_key, &fx_result->key);
}

static void _fx_free_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S(
   struct _fx_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S* dst)
{
   _fx_free_Rt24Hashset__hashset_entry_t1S(&dst->t0);
   fx_free_arr(&dst->t4);
   fx_free_arr(&dst->t5);
}

static void _fx_copy_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S(
   struct _fx_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S* src,
   struct _fx_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S* dst)
{
   _fx_copy_Rt24Hashset__hashset_entry_t1S(&src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   dst->t3 = src->t3;
   fx_copy_arr(&src->t4, &dst->t4);
   fx_copy_arr(&src->t5, &dst->t5);
}

static void _fx_make_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S(
   struct _fx_Rt24Hashset__hashset_entry_t1S* t0,
   int_ t1,
   int_ t2,
   int_ t3,
   fx_arr_t* t4,
   fx_arr_t* t5,
   struct _fx_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S* fx_result)
{
   _fx_copy_Rt24Hashset__hashset_entry_t1S(t0, &fx_result->t0);
   fx_result->t1 = t1;
   fx_result->t2 = t2;
   fx_result->t3 = t3;
   fx_copy_arr(t4, &fx_result->t4);
   fx_copy_arr(t5, &fx_result->t5);
}

static void _fx_free_Nt10Hashset__t1S(struct _fx_Nt10Hashset__t1S_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T6Rt24Hashset__hashset_entry_t1SiiiA1iA1Rt24Hashset__hashset_entry_t1S(&(*dst)->u.t); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_R13Ast__defval_t(struct _fx_R13Ast__defval_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->dv_typ);
   _fx_free_R16Ast__val_flags_t(&dst->dv_flags);
   fx_free_list_simple(&dst->dv_scope);
}

static void _fx_copy_R13Ast__defval_t(struct _fx_R13Ast__defval_t* src, struct _fx_R13Ast__defval_t* dst)
{
   dst->dv_name = src->dv_name;
   FX_COPY_PTR(src->dv_typ, &dst->dv_typ);
   _fx_copy_R16Ast__val_flags_t(&src->dv_flags, &dst->dv_flags);
   FX_COPY_PTR(src->dv_scope, &dst->dv_scope);
   dst->dv_loc = src->dv_loc;
}

static void _fx_make_R13Ast__defval_t(
   struct _fx_R9Ast__id_t* r_dv_name,
   struct _fx_N10Ast__typ_t_data_t* r_dv_typ,
   struct _fx_R16Ast__val_flags_t* r_dv_flags,
   struct _fx_LN12Ast__scope_t_data_t* r_dv_scope,
   struct _fx_R10Ast__loc_t* r_dv_loc,
   struct _fx_R13Ast__defval_t* fx_result)
{
   fx_result->dv_name = *r_dv_name;
   FX_COPY_PTR(r_dv_typ, &fx_result->dv_typ);
   _fx_copy_R16Ast__val_flags_t(r_dv_flags, &fx_result->dv_flags);
   FX_COPY_PTR(r_dv_scope, &fx_result->dv_scope);
   fx_result->dv_loc = *r_dv_loc;
}

static void _fx_free_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* dst)
{
   _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(&dst->root);
   fx_free_fp(&dst->cmp);
}

static void _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* src,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* dst)
{
   FX_COPY_PTR(src->root, &dst->root);
   FX_COPY_FP(&src->cmp, &dst->cmp);
}

static void _fx_make_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* r_root,
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t* r_cmp,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* fx_result)
{
   FX_COPY_PTR(r_root, &fx_result->root);
   FX_COPY_FP(r_cmp, &fx_result->cmp);
}

static void _fx_free_LN10Ast__pat_t(struct _fx_LN10Ast__pat_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN10Ast__pat_t, _fx_free_N10Ast__pat_t);
}

static int _fx_cons_LN10Ast__pat_t(
   struct _fx_N10Ast__pat_t_data_t* hd,
   struct _fx_LN10Ast__pat_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN10Ast__pat_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN10Ast__pat_t, FX_COPY_PTR);
}

static void _fx_free_rLR9Ast__id_t(struct _fx_rLR9Ast__id_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rLR9Ast__id_t, fx_free_list_simple);
}

static int _fx_make_rLR9Ast__id_t(struct _fx_LR9Ast__id_t_data_t* arg, struct _fx_rLR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rLR9Ast__id_t, FX_COPY_PTR);
}

static void _fx_free_R13Ast__deffun_t(struct _fx_R13Ast__deffun_t* dst)
{
   fx_free_list_simple(&dst->df_templ_args);
   _fx_free_LN10Ast__pat_t(&dst->df_args);
   _fx_free_N10Ast__typ_t(&dst->df_typ);
   _fx_free_N10Ast__exp_t(&dst->df_body);
   fx_free_list_simple(&dst->df_scope);
   _fx_free_rLR9Ast__id_t(&dst->df_templ_inst);
   _fx_free_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&dst->df_env);
}

static void _fx_copy_R13Ast__deffun_t(struct _fx_R13Ast__deffun_t* src, struct _fx_R13Ast__deffun_t* dst)
{
   dst->df_name = src->df_name;
   FX_COPY_PTR(src->df_templ_args, &dst->df_templ_args);
   FX_COPY_PTR(src->df_args, &dst->df_args);
   FX_COPY_PTR(src->df_typ, &dst->df_typ);
   FX_COPY_PTR(src->df_body, &dst->df_body);
   dst->df_flags = src->df_flags;
   FX_COPY_PTR(src->df_scope, &dst->df_scope);
   dst->df_loc = src->df_loc;
   FX_COPY_PTR(src->df_templ_inst, &dst->df_templ_inst);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&src->df_env, &dst->df_env);
}

static void _fx_make_R13Ast__deffun_t(
   struct _fx_R9Ast__id_t* r_df_name,
   struct _fx_LR9Ast__id_t_data_t* r_df_templ_args,
   struct _fx_LN10Ast__pat_t_data_t* r_df_args,
   struct _fx_N10Ast__typ_t_data_t* r_df_typ,
   struct _fx_N10Ast__exp_t_data_t* r_df_body,
   struct _fx_R16Ast__fun_flags_t* r_df_flags,
   struct _fx_LN12Ast__scope_t_data_t* r_df_scope,
   struct _fx_R10Ast__loc_t* r_df_loc,
   struct _fx_rLR9Ast__id_t_data_t* r_df_templ_inst,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* r_df_env,
   struct _fx_R13Ast__deffun_t* fx_result)
{
   fx_result->df_name = *r_df_name;
   FX_COPY_PTR(r_df_templ_args, &fx_result->df_templ_args);
   FX_COPY_PTR(r_df_args, &fx_result->df_args);
   FX_COPY_PTR(r_df_typ, &fx_result->df_typ);
   FX_COPY_PTR(r_df_body, &fx_result->df_body);
   fx_result->df_flags = *r_df_flags;
   FX_COPY_PTR(r_df_scope, &fx_result->df_scope);
   fx_result->df_loc = *r_df_loc;
   FX_COPY_PTR(r_df_templ_inst, &fx_result->df_templ_inst);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(r_df_env, &fx_result->df_env);
}

static void _fx_free_rR13Ast__deffun_t(struct _fx_rR13Ast__deffun_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR13Ast__deffun_t, _fx_free_R13Ast__deffun_t);
}

static int _fx_make_rR13Ast__deffun_t(struct _fx_R13Ast__deffun_t* arg, struct _fx_rR13Ast__deffun_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR13Ast__deffun_t, _fx_copy_R13Ast__deffun_t);
}

static void _fx_free_R13Ast__defexn_t(struct _fx_R13Ast__defexn_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->dexn_typ);
   fx_free_list_simple(&dst->dexn_scope);
}

static void _fx_copy_R13Ast__defexn_t(struct _fx_R13Ast__defexn_t* src, struct _fx_R13Ast__defexn_t* dst)
{
   dst->dexn_name = src->dexn_name;
   FX_COPY_PTR(src->dexn_typ, &dst->dexn_typ);
   FX_COPY_PTR(src->dexn_scope, &dst->dexn_scope);
   dst->dexn_loc = src->dexn_loc;
}

static void _fx_make_R13Ast__defexn_t(
   struct _fx_R9Ast__id_t* r_dexn_name,
   struct _fx_N10Ast__typ_t_data_t* r_dexn_typ,
   struct _fx_LN12Ast__scope_t_data_t* r_dexn_scope,
   struct _fx_R10Ast__loc_t* r_dexn_loc,
   struct _fx_R13Ast__defexn_t* fx_result)
{
   fx_result->dexn_name = *r_dexn_name;
   FX_COPY_PTR(r_dexn_typ, &fx_result->dexn_typ);
   FX_COPY_PTR(r_dexn_scope, &fx_result->dexn_scope);
   fx_result->dexn_loc = *r_dexn_loc;
}

static void _fx_free_rR13Ast__defexn_t(struct _fx_rR13Ast__defexn_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR13Ast__defexn_t, _fx_free_R13Ast__defexn_t);
}

static int _fx_make_rR13Ast__defexn_t(struct _fx_R13Ast__defexn_t* arg, struct _fx_rR13Ast__defexn_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR13Ast__defexn_t, _fx_copy_R13Ast__defexn_t);
}

static void _fx_free_R13Ast__deftyp_t(struct _fx_R13Ast__deftyp_t* dst)
{
   fx_free_list_simple(&dst->dt_templ_args);
   _fx_free_N10Ast__typ_t(&dst->dt_typ);
   fx_free_list_simple(&dst->dt_scope);
}

static void _fx_copy_R13Ast__deftyp_t(struct _fx_R13Ast__deftyp_t* src, struct _fx_R13Ast__deftyp_t* dst)
{
   dst->dt_name = src->dt_name;
   FX_COPY_PTR(src->dt_templ_args, &dst->dt_templ_args);
   FX_COPY_PTR(src->dt_typ, &dst->dt_typ);
   dst->dt_finalized = src->dt_finalized;
   FX_COPY_PTR(src->dt_scope, &dst->dt_scope);
   dst->dt_loc = src->dt_loc;
}

static void _fx_make_R13Ast__deftyp_t(
   struct _fx_R9Ast__id_t* r_dt_name,
   struct _fx_LR9Ast__id_t_data_t* r_dt_templ_args,
   struct _fx_N10Ast__typ_t_data_t* r_dt_typ,
   bool r_dt_finalized,
   struct _fx_LN12Ast__scope_t_data_t* r_dt_scope,
   struct _fx_R10Ast__loc_t* r_dt_loc,
   struct _fx_R13Ast__deftyp_t* fx_result)
{
   fx_result->dt_name = *r_dt_name;
   FX_COPY_PTR(r_dt_templ_args, &fx_result->dt_templ_args);
   FX_COPY_PTR(r_dt_typ, &fx_result->dt_typ);
   fx_result->dt_finalized = r_dt_finalized;
   FX_COPY_PTR(r_dt_scope, &fx_result->dt_scope);
   fx_result->dt_loc = *r_dt_loc;
}

static void _fx_free_rR13Ast__deftyp_t(struct _fx_rR13Ast__deftyp_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR13Ast__deftyp_t, _fx_free_R13Ast__deftyp_t);
}

static int _fx_make_rR13Ast__deftyp_t(struct _fx_R13Ast__deftyp_t* arg, struct _fx_rR13Ast__deftyp_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR13Ast__deftyp_t, _fx_copy_R13Ast__deftyp_t);
}

static void _fx_free_T2R9Ast__id_tN10Ast__typ_t(struct _fx_T2R9Ast__id_tN10Ast__typ_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN10Ast__typ_t(
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* src,
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN10Ast__typ_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN10Ast__typ_t(struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__typ_t, _fx_free_T2R9Ast__id_tN10Ast__typ_t);
}

static int _fx_cons_LT2R9Ast__id_tN10Ast__typ_t(
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* hd,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__typ_t, _fx_copy_T2R9Ast__id_tN10Ast__typ_t);
}

static int _fx_cons_LTa2R9Ast__id_t(
   struct _fx_Ta2R9Ast__id_t* hd,
   struct _fx_LTa2R9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LTa2R9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LTa2R9Ast__id_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_T2R9Ast__id_tLTa2R9Ast__id_t(struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* dst)
{
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* src,
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LTa2R9Ast__id_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tLTa2R9Ast__id_t, _fx_free_T2R9Ast__id_tLTa2R9Ast__id_t);
}

static int _fx_cons_LT2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* hd,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tLTa2R9Ast__id_t, _fx_copy_T2R9Ast__id_tLTa2R9Ast__id_t);
}

static void _fx_free_R17Ast__defvariant_t(struct _fx_R17Ast__defvariant_t* dst)
{
   fx_free_list_simple(&dst->dvar_templ_args);
   _fx_free_N10Ast__typ_t(&dst->dvar_alias);
   _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&dst->dvar_cases);
   fx_free_list_simple(&dst->dvar_ctors);
   _fx_free_rLR9Ast__id_t(&dst->dvar_templ_inst);
   _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(&dst->dvar_ifaces);
   fx_free_list_simple(&dst->dvar_scope);
}

static void _fx_copy_R17Ast__defvariant_t(struct _fx_R17Ast__defvariant_t* src, struct _fx_R17Ast__defvariant_t* dst)
{
   dst->dvar_name = src->dvar_name;
   FX_COPY_PTR(src->dvar_templ_args, &dst->dvar_templ_args);
   FX_COPY_PTR(src->dvar_alias, &dst->dvar_alias);
   dst->dvar_flags = src->dvar_flags;
   FX_COPY_PTR(src->dvar_cases, &dst->dvar_cases);
   FX_COPY_PTR(src->dvar_ctors, &dst->dvar_ctors);
   FX_COPY_PTR(src->dvar_templ_inst, &dst->dvar_templ_inst);
   FX_COPY_PTR(src->dvar_ifaces, &dst->dvar_ifaces);
   FX_COPY_PTR(src->dvar_scope, &dst->dvar_scope);
   dst->dvar_loc = src->dvar_loc;
}

static void _fx_make_R17Ast__defvariant_t(
   struct _fx_R9Ast__id_t* r_dvar_name,
   struct _fx_LR9Ast__id_t_data_t* r_dvar_templ_args,
   struct _fx_N10Ast__typ_t_data_t* r_dvar_alias,
   struct _fx_R16Ast__var_flags_t* r_dvar_flags,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* r_dvar_cases,
   struct _fx_LR9Ast__id_t_data_t* r_dvar_ctors,
   struct _fx_rLR9Ast__id_t_data_t* r_dvar_templ_inst,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* r_dvar_ifaces,
   struct _fx_LN12Ast__scope_t_data_t* r_dvar_scope,
   struct _fx_R10Ast__loc_t* r_dvar_loc,
   struct _fx_R17Ast__defvariant_t* fx_result)
{
   fx_result->dvar_name = *r_dvar_name;
   FX_COPY_PTR(r_dvar_templ_args, &fx_result->dvar_templ_args);
   FX_COPY_PTR(r_dvar_alias, &fx_result->dvar_alias);
   fx_result->dvar_flags = *r_dvar_flags;
   FX_COPY_PTR(r_dvar_cases, &fx_result->dvar_cases);
   FX_COPY_PTR(r_dvar_ctors, &fx_result->dvar_ctors);
   FX_COPY_PTR(r_dvar_templ_inst, &fx_result->dvar_templ_inst);
   FX_COPY_PTR(r_dvar_ifaces, &fx_result->dvar_ifaces);
   FX_COPY_PTR(r_dvar_scope, &fx_result->dvar_scope);
   fx_result->dvar_loc = *r_dvar_loc;
}

static void _fx_free_rR17Ast__defvariant_t(struct _fx_rR17Ast__defvariant_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR17Ast__defvariant_t, _fx_free_R17Ast__defvariant_t);
}

static int _fx_make_rR17Ast__defvariant_t(
   struct _fx_R17Ast__defvariant_t* arg,
   struct _fx_rR17Ast__defvariant_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR17Ast__defvariant_t, _fx_copy_R17Ast__defvariant_t);
}

static void _fx_free_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* src,
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_R16Ast__fun_flags_t* t2,
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t,
      _fx_free_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t);
}

static int _fx_cons_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* hd,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t,
      _fx_copy_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t);
}

static void _fx_free_R19Ast__definterface_t(struct _fx_R19Ast__definterface_t* dst)
{
   _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&dst->di_new_methods);
   _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&dst->di_all_methods);
   fx_free_list_simple(&dst->di_scope);
}

static void _fx_copy_R19Ast__definterface_t(struct _fx_R19Ast__definterface_t* src, struct _fx_R19Ast__definterface_t* dst)
{
   dst->di_name = src->di_name;
   dst->di_base = src->di_base;
   FX_COPY_PTR(src->di_new_methods, &dst->di_new_methods);
   FX_COPY_PTR(src->di_all_methods, &dst->di_all_methods);
   FX_COPY_PTR(src->di_scope, &dst->di_scope);
   dst->di_loc = src->di_loc;
}

static void _fx_make_R19Ast__definterface_t(
   struct _fx_R9Ast__id_t* r_di_name,
   struct _fx_R9Ast__id_t* r_di_base,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* r_di_new_methods,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* r_di_all_methods,
   struct _fx_LN12Ast__scope_t_data_t* r_di_scope,
   struct _fx_R10Ast__loc_t* r_di_loc,
   struct _fx_R19Ast__definterface_t* fx_result)
{
   fx_result->di_name = *r_di_name;
   fx_result->di_base = *r_di_base;
   FX_COPY_PTR(r_di_new_methods, &fx_result->di_new_methods);
   FX_COPY_PTR(r_di_all_methods, &fx_result->di_all_methods);
   FX_COPY_PTR(r_di_scope, &fx_result->di_scope);
   fx_result->di_loc = *r_di_loc;
}

static void _fx_free_rR19Ast__definterface_t(struct _fx_rR19Ast__definterface_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR19Ast__definterface_t, _fx_free_R19Ast__definterface_t);
}

static int _fx_make_rR19Ast__definterface_t(
   struct _fx_R19Ast__definterface_t* arg,
   struct _fx_rR19Ast__definterface_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR19Ast__definterface_t, _fx_copy_R19Ast__definterface_t);
}

static void _fx_free_N14Ast__id_info_t(struct _fx_N14Ast__id_info_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_R13Ast__defval_t(&dst->u.IdDVal); break;
   case 3:
      _fx_free_rR13Ast__deffun_t(&dst->u.IdFun); break;
   case 4:
      _fx_free_rR13Ast__defexn_t(&dst->u.IdExn); break;
   case 5:
      _fx_free_rR13Ast__deftyp_t(&dst->u.IdTyp); break;
   case 6:
      _fx_free_rR17Ast__defvariant_t(&dst->u.IdVariant); break;
   case 7:
      _fx_free_rR19Ast__definterface_t(&dst->u.IdInterface); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N14Ast__id_info_t(struct _fx_N14Ast__id_info_t* src, struct _fx_N14Ast__id_info_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_R13Ast__defval_t(&src->u.IdDVal, &dst->u.IdDVal); break;
   case 3:
      FX_COPY_PTR(src->u.IdFun, &dst->u.IdFun); break;
   case 4:
      FX_COPY_PTR(src->u.IdExn, &dst->u.IdExn); break;
   case 5:
      FX_COPY_PTR(src->u.IdTyp, &dst->u.IdTyp); break;
   case 6:
      FX_COPY_PTR(src->u.IdVariant, &dst->u.IdVariant); break;
   case 7:
      FX_COPY_PTR(src->u.IdInterface, &dst->u.IdInterface); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T3iA1N14Ast__id_info_tN14Ast__id_info_t(struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* dst)
{
   fx_free_arr(&dst->t1);
   _fx_free_N14Ast__id_info_t(&dst->t2);
}

static void _fx_copy_T3iA1N14Ast__id_info_tN14Ast__id_info_t(
   struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* src,
   struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* dst)
{
   dst->t0 = src->t0;
   fx_copy_arr(&src->t1, &dst->t1);
   _fx_copy_N14Ast__id_info_t(&src->t2, &dst->t2);
}

static void _fx_make_T3iA1N14Ast__id_info_tN14Ast__id_info_t(
   int_ t0,
   fx_arr_t* t1,
   struct _fx_N14Ast__id_info_t* t2,
   struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* fx_result)
{
   fx_result->t0 = t0;
   fx_copy_arr(t1, &fx_result->t1);
   _fx_copy_N14Ast__id_info_t(t2, &fx_result->t2);
}

static void _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T3iA1N14Ast__id_info_tN14Ast__id_info_t(&(*dst)->u.t); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_LN16Ast__env_entry_t(struct _fx_LN16Ast__env_entry_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN16Ast__env_entry_t, _fx_free_N16Ast__env_entry_t);
}

static int _fx_cons_LN16Ast__env_entry_t(
   struct _fx_N16Ast__env_entry_t_data_t* hd,
   struct _fx_LN16Ast__env_entry_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN16Ast__env_entry_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN16Ast__env_entry_t, FX_COPY_PTR);
}

static void
   _fx_free_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      dst)
{
   _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(&dst->t1);
   _fx_free_LN16Ast__env_entry_t(&dst->t3);
   _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(&dst->t4);
}

static void
   _fx_copy_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      src,
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   FX_COPY_PTR(src->t3, &dst->t3);
   FX_COPY_PTR(src->t4, &dst->t4);
}

static void
   _fx_make_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_N12Map__color_t* t0,
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t1,
   struct _fx_R9Ast__id_t* t2,
   struct _fx_LN16Ast__env_entry_t_data_t* t3,
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t4,
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   FX_COPY_PTR(t3, &fx_result->t3);
   FX_COPY_PTR(t4, &fx_result->t4);
}

static void _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
         &(*dst)->u.Node);
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2R10Ast__loc_tS(struct _fx_T2R10Ast__loc_tS* dst)
{
   fx_free_str(&dst->t1);
}

static void _fx_copy_T2R10Ast__loc_tS(struct _fx_T2R10Ast__loc_tS* src, struct _fx_T2R10Ast__loc_tS* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_T2R10Ast__loc_tS(struct _fx_R10Ast__loc_t* t0, fx_str_t* t1, struct _fx_T2R10Ast__loc_tS* fx_result)
{
   fx_result->t0 = *t0;
   fx_copy_str(t1, &fx_result->t1);
}

static void _fx_free_N10Ast__lit_t(struct _fx_N10Ast__lit_t* dst)
{
   switch (dst->tag) {
   case 5:
      fx_free_str(&dst->u.LitString); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N10Ast__lit_t(struct _fx_N10Ast__lit_t* src, struct _fx_N10Ast__lit_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 5:
      fx_copy_str(&src->u.LitString, &dst->u.LitString); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_rNt6option1N10Ast__typ_t(struct _fx_rNt6option1N10Ast__typ_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rNt6option1N10Ast__typ_t, _fx_free_Nt6option1N10Ast__typ_t);
}

static int _fx_make_rNt6option1N10Ast__typ_t(
   struct _fx_Nt6option1N10Ast__typ_t_data_t* arg,
   struct _fx_rNt6option1N10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rNt6option1N10Ast__typ_t, FX_COPY_PTR);
}

static void _fx_free_LN10Ast__typ_t(struct _fx_LN10Ast__typ_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN10Ast__typ_t, _fx_free_N10Ast__typ_t);
}

static int _fx_cons_LN10Ast__typ_t(
   struct _fx_N10Ast__typ_t_data_t* hd,
   struct _fx_LN10Ast__typ_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN10Ast__typ_t, FX_COPY_PTR);
}

static void _fx_free_T2LN10Ast__typ_tN10Ast__typ_t(struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* dst)
{
   _fx_free_LN10Ast__typ_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__typ_tN10Ast__typ_t(
   struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* src,
   struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__typ_tN10Ast__typ_t(
   struct _fx_LN10Ast__typ_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2iN10Ast__typ_t(struct _fx_T2iN10Ast__typ_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2iN10Ast__typ_t(struct _fx_T2iN10Ast__typ_t* src, struct _fx_T2iN10Ast__typ_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2iN10Ast__typ_t(int_ t0, struct _fx_N10Ast__typ_t_data_t* t1, struct _fx_T2iN10Ast__typ_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   _fx_free_R16Ast__val_flags_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t2);
   _fx_free_N10Ast__exp_t(&dst->t3);
}

static void _fx_copy_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* src,
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   _fx_copy_R16Ast__val_flags_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   FX_COPY_PTR(src->t3, &dst->t3);
}

static void _fx_make_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_R16Ast__val_flags_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_N10Ast__typ_t_data_t* t2,
   struct _fx_N10Ast__exp_t_data_t* t3,
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* fx_result)
{
   _fx_copy_R16Ast__val_flags_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   FX_COPY_PTR(t3, &fx_result->t3);
}

static void _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t,
      _fx_free_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t);
}

static int _fx_cons_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* hd,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t,
      _fx_copy_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t);
}

static void _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* dst)
{
   _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&dst->t0);
}

static void _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* src,
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t0,
   bool t1,
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
}

static void _fx_free_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB,
      _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB);
}

static int _fx_make_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* arg,
   struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB,
      _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB);
}

static void _fx_free_T2LN10Ast__typ_tR9Ast__id_t(struct _fx_T2LN10Ast__typ_tR9Ast__id_t* dst)
{
   _fx_free_LN10Ast__typ_t(&dst->t0);
}

static void _fx_copy_T2LN10Ast__typ_tR9Ast__id_t(
   struct _fx_T2LN10Ast__typ_tR9Ast__id_t* src,
   struct _fx_T2LN10Ast__typ_tR9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LN10Ast__typ_tR9Ast__id_t(
   struct _fx_LN10Ast__typ_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_T2LN10Ast__typ_tR9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_N10Ast__typ_t(struct _fx_N10Ast__typ_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 1:
         _fx_free_rNt6option1N10Ast__typ_t(&(*dst)->u.TypVar); break;
      case 2:
         _fx_free_Nt6option1N10Ast__typ_t(&(*dst)->u.TypVarTuple); break;
      case 3:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypVarArray); break;
      case 14:
         _fx_free_T2LN10Ast__typ_tN10Ast__typ_t(&(*dst)->u.TypFun); break;
      case 15:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypList); break;
      case 16:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypVector); break;
      case 17:
         _fx_free_LN10Ast__typ_t(&(*dst)->u.TypTuple); break;
      case 18:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypRef); break;
      case 19:
         _fx_free_T2iN10Ast__typ_t(&(*dst)->u.TypArray); break;
      case 20:
         _fx_free_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&(*dst)->u.TypRecord); break;
      case 24:
         _fx_free_T2LN10Ast__typ_tR9Ast__id_t(&(*dst)->u.TypApp); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_N13Ast__binary_t(struct _fx_N13Ast__binary_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 27:
         _fx_free_N13Ast__binary_t(&(*dst)->u.OpAugBinary); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t0);
}

static void _fx_copy_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__typ_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t0);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t1);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__lit_t(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_copy_N10Ast__lit_t(&src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__lit_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N10Ast__lit_t(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N13Ast__binary_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N13Ast__binary_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N12Ast__unary_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_LN10Ast__exp_t(struct _fx_LN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN10Ast__exp_t, _fx_free_N10Ast__exp_t);
}

static int _fx_cons_LN10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* hd,
   struct _fx_LN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN10Ast__exp_t, FX_COPY_PTR);
}

static void _fx_free_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N13Ast__intrin_t* t0,
   struct _fx_LN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2R9Ast__id_tN10Ast__exp_t(struct _fx_T2R9Ast__id_tN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN10Ast__exp_t(
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* src,
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN10Ast__exp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__exp_t(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_LN10Ast__exp_t_data_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_LLN10Ast__exp_t(struct _fx_LLN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LLN10Ast__exp_t, _fx_free_LN10Ast__exp_t);
}

static int _fx_cons_LLN10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* hd,
   struct _fx_LLN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LLN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LLN10Ast__exp_t, FX_COPY_PTR);
}

static void _fx_free_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LLN10Ast__exp_t(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_LLN10Ast__exp_t_data_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN10Ast__exp_t(struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__exp_t, _fx_free_T2R9Ast__id_tN10Ast__exp_t);
}

static int _fx_cons_LT2R9Ast__id_tN10Ast__exp_t(
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* hd,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__exp_t, _fx_copy_T2R9Ast__id_tN10Ast__exp_t);
}

static void _fx_free_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t3);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t4);
}

static void _fx_copy_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   FX_COPY_PTR(src->t3, &dst->t3);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t4, &dst->t4);
}

static void _fx_make_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N13Ast__border_t* t1,
   struct _fx_N18Ast__interpolate_t* t2,
   struct _fx_LN10Ast__exp_t_data_t* t3,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t4,
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = *t2;
   FX_COPY_PTR(t3, &fx_result->t3);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t4, &fx_result->t4);
}

static void _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2N10Ast__exp_tR10Ast__loc_t(struct _fx_T2N10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T2N10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__exp_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T2N10Ast__pat_tN10Ast__exp_t(struct _fx_T2N10Ast__pat_tN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* src,
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2N10Ast__pat_tN10Ast__exp_t, _fx_free_T2N10Ast__pat_tN10Ast__exp_t);
}

static int _fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* hd,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2N10Ast__pat_tN10Ast__exp_t, _fx_copy_T2N10Ast__pat_tN10Ast__exp_t);
}

static void _fx_free_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* src,
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
   dst->t4 = src->t4;
}

static void _fx_make_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_R16Ast__for_flags_t* t3,
   struct _fx_R10Ast__loc_t* t4,
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = *t3;
   fx_result->t4 = *t4;
}

static void _fx_free_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* dst)
{
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* src,
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t, _fx_free_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t);
}

static int _fx_cons_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* hd,
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t, _fx_copy_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t);
}

static void
   _fx_free_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void
   _fx_copy_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void
   _fx_make_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R16Ast__for_flags_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t*
      fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2ST2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_free_str(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2ST2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2ST2N10Ast__typ_tR10Ast__loc_t(
   fx_str_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T3SST2N10Ast__typ_tR10Ast__loc_t(struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_free_str(&dst->t0);
   fx_free_str(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3SST2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   fx_copy_str(&src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3SST2N10Ast__typ_tR10Ast__loc_t(
   fx_str_t* t0,
   fx_str_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   fx_copy_str(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_R16Ast__val_flags_t(&dst->t2);
}

static void _fx_copy_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* src,
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_R16Ast__val_flags_t(&src->t2, &dst->t2);
   dst->t3 = src->t3;
}

static void _fx_make_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R16Ast__val_flags_t* t2,
   struct _fx_R10Ast__loc_t* t3,
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_R16Ast__val_flags_t(t2, &fx_result->t2);
   fx_result->t3 = *t3;
}

static int _fx_cons_LT2iR9Ast__id_t(
   struct _fx_T2iR9Ast__id_t* hd,
   struct _fx_LT2iR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2iR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2iR9Ast__id_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_T2LT2iR9Ast__id_tR10Ast__loc_t(struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* dst)
{
   fx_free_list_simple(&dst->t0);
}

static void _fx_copy_T2LT2iR9Ast__id_tR10Ast__loc_t(
   struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT2iR9Ast__id_tR10Ast__loc_t(
   struct _fx_LT2iR9Ast__id_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T3iLR9Ast__id_tR10Ast__loc_t(struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* dst)
{
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T3iLR9Ast__id_tR10Ast__loc_t(
   struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3iLR9Ast__id_tR10Ast__loc_t(
   int_ t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2LSR10Ast__loc_t(struct _fx_T2LSR10Ast__loc_t* dst)
{
   _fx_free_LS(&dst->t0);
}

static void _fx_copy_T2LSR10Ast__loc_t(struct _fx_T2LSR10Ast__loc_t* src, struct _fx_T2LSR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LSR10Ast__loc_t(
   struct _fx_LS_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LSR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_N10Ast__exp_t(struct _fx_N10Ast__exp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 4:
         _fx_free_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpReturn); break;
      case 5:
         _fx_free_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
            &(*dst)->u.ExpRange);
         break;
      case 6:
         _fx_free_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpLit); break;
      case 7:
         _fx_free_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpIdent); break;
      case 8:
         _fx_free_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpBinary); break;
      case 9:
         _fx_free_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpUnary); break;
      case 10:
         _fx_free_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpIntrin); break;
      case 11:
         _fx_free_T2R9Ast__id_tN10Ast__exp_t(&(*dst)->u.ExpSync); break;
      case 12:
         _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpSeq); break;
      case 13:
         _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkTuple); break;
      case 14:
         _fx_free_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkArray); break;
      case 15:
         _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkVector); break;
      case 16:
         _fx_free_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkRecord); break;
      case 17:
         _fx_free_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpUpdateRecord); break;
      case 18:
         _fx_free_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpCall); break;
      case 19:
         _fx_free_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
            &(*dst)->u.ExpAt);
         break;
      case 20:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpAssign); break;
      case 21:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMem); break;
      case 22:
         _fx_free_T2N10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpThrow); break;
      case 23:
         _fx_free_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpIf); break;
      case 24:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpWhile); break;
      case 25:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpDoWhile); break;
      case 26:
         _fx_free_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(&(*dst)->u.ExpFor);
         break;
      case 27:
         _fx_free_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
            &(*dst)->u.ExpMap);
         break;
      case 28:
         _fx_free_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpTryCatch); break;
      case 29:
         _fx_free_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMatch); break;
      case 30:
         _fx_free_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpCast); break;
      case 31:
         _fx_free_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpTyped); break;
      case 32:
         _fx_free_T2ST2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpCCode); break;
      case 33:
         _fx_free_T3SST2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpData); break;
      case 34:
         _fx_free_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(&(*dst)->u.DefVal); break;
      case 35:
         _fx_free_rR13Ast__deffun_t(&(*dst)->u.DefFun); break;
      case 36:
         _fx_free_rR13Ast__defexn_t(&(*dst)->u.DefExn); break;
      case 37:
         _fx_free_rR13Ast__deftyp_t(&(*dst)->u.DefTyp); break;
      case 38:
         _fx_free_rR17Ast__defvariant_t(&(*dst)->u.DefVariant); break;
      case 39:
         _fx_free_rR19Ast__definterface_t(&(*dst)->u.DefInterface); break;
      case 40:
         _fx_free_T2LT2iR9Ast__id_tR10Ast__loc_t(&(*dst)->u.DirImport); break;
      case 41:
         _fx_free_T3iLR9Ast__id_tR10Ast__loc_t(&(*dst)->u.DirImportFrom); break;
      case 42:
         _fx_free_T2LSR10Ast__loc_t(&(*dst)->u.DirPragma); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2N10Ast__lit_tR10Ast__loc_t(struct _fx_T2N10Ast__lit_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__lit_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__lit_tR10Ast__loc_t(
   struct _fx_T2N10Ast__lit_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__lit_tR10Ast__loc_t* dst)
{
   _fx_copy_N10Ast__lit_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__lit_tR10Ast__loc_t(
   struct _fx_N10Ast__lit_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__lit_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N10Ast__lit_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2LN10Ast__pat_tR10Ast__loc_t(struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T2LN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LN10Ast__pat_tR10Ast__loc_t(
   struct _fx_LN10Ast__pat_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LN10Ast__pat_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2R9Ast__id_tN10Ast__pat_t(struct _fx_T2R9Ast__id_tN10Ast__pat_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN10Ast__pat_t(
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* src,
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN10Ast__pat_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN10Ast__pat_t(struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__pat_t, _fx_free_T2R9Ast__id_tN10Ast__pat_t);
}

static int _fx_cons_LT2R9Ast__id_tN10Ast__pat_t(
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* hd,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__pat_t, _fx_copy_T2R9Ast__id_tN10Ast__pat_t);
}

static void _fx_free_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_Nt6option1R9Ast__id_t* t0,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2N10Ast__pat_tR10Ast__loc_t(struct _fx_T2N10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__pat_tR10Ast__loc_t(
   struct _fx_T2N10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__pat_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__pat_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__pat_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_N10Ast__pat_t(struct _fx_N10Ast__pat_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 2:
         _fx_free_T2N10Ast__lit_tR10Ast__loc_t(&(*dst)->u.PatLit); break;
      case 4:
         _fx_free_T2LN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatTuple); break;
      case 5:
         _fx_free_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatVariant); break;
      case 6:
         _fx_free_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatRecord); break;
      case 7:
         _fx_free_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatCons); break;
      case 8:
         _fx_free_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(&(*dst)->u.PatAs); break;
      case 9:
         _fx_free_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(&(*dst)->u.PatTyped); break;
      case 10:
         _fx_free_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.PatWhen); break;
      case 11:
         _fx_free_T2LN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatAlt); break;
      case 12:
         _fx_free_T2N10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatRef); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_N16Ast__env_entry_t(struct _fx_N16Ast__env_entry_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) { case 2:     _fx_free_N10Ast__typ_t(&(*dst)->u.EnvTyp); break; default:    ; } fx_free(*dst);
   }
   *dst = 0;
}

static int _fx_cons_Li(int_ hd, struct _fx_Li_data_t* tl, bool addref_tl, struct _fx_Li_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_Li, FX_COPY_SIMPLE);
}

static void _fx_free_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t* dst)
{
   fx_free_str(&dst->t1);
   _fx_free_LN10Ast__exp_t(&dst->t4);
   fx_free_list_simple(&dst->t5);
   _fx_free_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&dst->t6);
   _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(&dst->t9);
}

static void _fx_copy_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t* src,
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
   dst->t2 = src->t2;
   dst->t3 = src->t3;
   FX_COPY_PTR(src->t4, &dst->t4);
   FX_COPY_PTR(src->t5, &dst->t5);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&src->t6, &dst->t6);
   dst->t7 = src->t7;
   dst->t8 = src->t8;
   FX_COPY_PTR(src->t9, &dst->t9);
}

static void _fx_make_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
   struct _fx_R9Ast__id_t* t0,
   fx_str_t* t1,
   int_ t2,
   bool t3,
   struct _fx_LN10Ast__exp_t_data_t* t4,
   struct _fx_Li_data_t* t5,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* t6,
   bool t7,
   int_ t8,
   struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t* t9,
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t*
      fx_result)
{
   fx_result->t0 = *t0;
   fx_copy_str(t1, &fx_result->t1);
   fx_result->t2 = t2;
   fx_result->t3 = t3;
   FX_COPY_PTR(t4, &fx_result->t4);
   FX_COPY_PTR(t5, &fx_result->t5);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(t6, &fx_result->t6);
   fx_result->t7 = t7;
   fx_result->t8 = t8;
   FX_COPY_PTR(t9, &fx_result->t9);
}

static void _fx_free_N16Ast__defmodule_t(struct _fx_N16Ast__defmodule_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
         &(*dst)->u.defmodule_t);
      fx_free(*dst);
   }
   *dst = 0;
}

static int _fx_cons_LR10Ast__loc_t(
   struct _fx_R10Ast__loc_t* hd,
   struct _fx_LR10Ast__loc_t_data_t* tl,
   bool addref_tl,
   struct _fx_LR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LR10Ast__loc_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_T2BS(struct _fx_T2BS* dst)
{
   fx_free_str(&dst->t1);
}

static void _fx_copy_T2BS(struct _fx_T2BS* src, struct _fx_T2BS* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_T2BS(bool t0, fx_str_t* t1, struct _fx_T2BS* fx_result)
{
   fx_result->t0 = t0;
   fx_copy_str(t1, &fx_result->t1);
}

static void _fx_free_N14Lexer__token_t(struct _fx_N14Lexer__token_t* dst)
{
   switch (dst->tag) {
   case 1:
      _fx_free_N10Ast__lit_t(&dst->u.LITERAL); break;
   case 2:
      _fx_free_T2BS(&dst->u.IDENT); break;
   case 3:
      fx_free_str(&dst->u.TYVAR); break;
   case 13:
      fx_free_str(&dst->u.DATA); break;
   case 88:
      _fx_free_N13Ast__binary_t(&dst->u.AUG_BINOP); break;
   case 94:
      fx_free_str(&dst->u.RESERVED); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N14Lexer__token_t(struct _fx_N14Lexer__token_t* src, struct _fx_N14Lexer__token_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 1:
      _fx_copy_N10Ast__lit_t(&src->u.LITERAL, &dst->u.LITERAL); break;
   case 2:
      _fx_copy_T2BS(&src->u.IDENT, &dst->u.IDENT); break;
   case 3:
      fx_copy_str(&src->u.TYVAR, &dst->u.TYVAR); break;
   case 13:
      fx_copy_str(&src->u.DATA, &dst->u.DATA); break;
   case 88:
      FX_COPY_PTR(src->u.AUG_BINOP, &dst->u.AUG_BINOP); break;
   case 94:
      fx_copy_str(&src->u.RESERVED, &dst->u.RESERVED); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T2N14Lexer__token_tTa2i(struct _fx_T2N14Lexer__token_tTa2i* dst)
{
   _fx_free_N14Lexer__token_t(&dst->t0);
}

static void _fx_copy_T2N14Lexer__token_tTa2i(struct _fx_T2N14Lexer__token_tTa2i* src, struct _fx_T2N14Lexer__token_tTa2i* dst)
{
   _fx_copy_N14Lexer__token_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N14Lexer__token_tTa2i(
   struct _fx_N14Lexer__token_t* t0,
   struct _fx_Ta2i* t1,
   struct _fx_T2N14Lexer__token_tTa2i* fx_result)
{
   _fx_copy_N14Lexer__token_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_LT2N14Lexer__token_tTa2i(struct _fx_LT2N14Lexer__token_tTa2i_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2N14Lexer__token_tTa2i, _fx_free_T2N14Lexer__token_tTa2i);
}

static int _fx_cons_LT2N14Lexer__token_tTa2i(
   struct _fx_T2N14Lexer__token_tTa2i* hd,
   struct _fx_LT2N14Lexer__token_tTa2i_data_t* tl,
   bool addref_tl,
   struct _fx_LT2N14Lexer__token_tTa2i_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2N14Lexer__token_tTa2i, _fx_copy_T2N14Lexer__token_tTa2i);
}

static void _fx_free_LN14Lexer__token_t(struct _fx_LN14Lexer__token_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN14Lexer__token_t, _fx_free_N14Lexer__token_t);
}

static int _fx_cons_LN14Lexer__token_t(
   struct _fx_N14Lexer__token_t* hd,
   struct _fx_LN14Lexer__token_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN14Lexer__token_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN14Lexer__token_t, _fx_copy_N14Lexer__token_t);
}

static void _fx_free_Ta2S(struct _fx_Ta2S* dst)
{
   fx_free_str(&dst->t0);
   fx_free_str(&dst->t1);
}

static void _fx_copy_Ta2S(struct _fx_Ta2S* src, struct _fx_Ta2S* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_Ta2S(fx_str_t* t0, fx_str_t* t1, struct _fx_Ta2S* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   fx_copy_str(t1, &fx_result->t1);
}

static void _fx_free_N15Parser__ppval_t(struct _fx_N15Parser__ppval_t* dst)
{
   switch (dst->tag) {
   case 3:
      fx_free_str(&dst->u.PP_STRING); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N15Parser__ppval_t(struct _fx_N15Parser__ppval_t* src, struct _fx_N15Parser__ppval_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 3:
      fx_copy_str(&src->u.PP_STRING, &dst->u.PP_STRING); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_Nt6option1N15Parser__ppval_t(struct _fx_Nt6option1N15Parser__ppval_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_N15Parser__ppval_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1N15Parser__ppval_t(
   struct _fx_Nt6option1N15Parser__ppval_t* src,
   struct _fx_Nt6option1N15Parser__ppval_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_N15Parser__ppval_t(&src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
}

static void _fx_make_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t2,
   struct _fx_R10Ast__loc_t* t3,
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = *t3;
}

static void _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t,
      _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t);
}

static int _fx_cons_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* hd,
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t,
      _fx_copy_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t);
}

static void _fx_free_LNt6option1N10Ast__exp_t(struct _fx_LNt6option1N10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LNt6option1N10Ast__exp_t, _fx_free_Nt6option1N10Ast__exp_t);
}

static int _fx_cons_LNt6option1N10Ast__exp_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* hd,
   struct _fx_LNt6option1N10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LNt6option1N10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LNt6option1N10Ast__exp_t, FX_COPY_PTR);
}

static void _fx_free_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t* src,
   struct _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_T2N12Ast__cmpop_tR10Ast__loc_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t,
      _fx_free_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t);
}

static int _fx_cons_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t* hd,
   struct _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t,
      _fx_copy_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t);
}

static void _fx_free_T2N14Lexer__token_tR10Ast__loc_t(struct _fx_T2N14Lexer__token_tR10Ast__loc_t* dst)
{
   _fx_free_N14Lexer__token_t(&dst->t0);
}

static void _fx_copy_T2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_T2N14Lexer__token_tR10Ast__loc_t* src,
   struct _fx_T2N14Lexer__token_tR10Ast__loc_t* dst)
{
   _fx_copy_N14Lexer__token_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_N14Lexer__token_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N14Lexer__token_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N14Lexer__token_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2N14Lexer__token_tR10Ast__loc_t, _fx_free_T2N14Lexer__token_tR10Ast__loc_t);
}

static int _fx_cons_LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_T2N14Lexer__token_tR10Ast__loc_t* hd,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2N14Lexer__token_tR10Ast__loc_t, _fx_copy_T2N14Lexer__token_tR10Ast__loc_t);
}

static int _fx_cons_LT2N19Parser__ppifstate_tR10Ast__loc_t(
   struct _fx_T2N19Parser__ppifstate_tR10Ast__loc_t* hd,
   struct _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2N19Parser__ppifstate_tR10Ast__loc_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(struct _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t, _fx_free_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t);
}

static int _fx_cons_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* hd,
   struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t, _fx_copy_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t);
}

static void _fx_free_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&dst->t0);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t* t0,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t,
      _fx_free_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t);
}

static int _fx_cons_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t* hd,
   struct _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t,
      _fx_copy_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t);
}

static void _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(struct _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* dst)
{
   fx_free_str(&dst->key);
   _fx_free_N15Parser__ppval_t(&dst->data);
}

static void _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
   struct _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* src,
   struct _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* dst)
{
   dst->hv = src->hv;
   fx_copy_str(&src->key, &dst->key);
   _fx_copy_N15Parser__ppval_t(&src->data, &dst->data);
}

static void _fx_make_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
   uint64_t r_hv,
   fx_str_t* r_key,
   struct _fx_N15Parser__ppval_t* r_data,
   struct _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* fx_result)
{
   fx_result->hv = r_hv;
   fx_copy_str(r_key, &fx_result->key);
   _fx_copy_N15Parser__ppval_t(r_data, &fx_result->data);
}

static void _fx_free_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
   struct _fx_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* dst)
{
   _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&dst->t0);
   fx_free_arr(&dst->t4);
   fx_free_arr(&dst->t5);
}

static void _fx_copy_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
   struct _fx_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* src,
   struct _fx_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* dst)
{
   _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   dst->t3 = src->t3;
   fx_copy_arr(&src->t4, &dst->t4);
   fx_copy_arr(&src->t5, &dst->t5);
}

static void _fx_make_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
   struct _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* t0,
   int_ t1,
   int_ t2,
   int_ t3,
   fx_arr_t* t4,
   fx_arr_t* t5,
   struct _fx_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* fx_result)
{
   _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(t0, &fx_result->t0);
   fx_result->t1 = t1;
   fx_result->t2 = t2;
   fx_result->t3 = t3;
   fx_copy_arr(t4, &fx_result->t4);
   fx_copy_arr(t5, &fx_result->t5);
}

static void _fx_free_Nt10Hashmap__t2SN15Parser__ppval_t(struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&(*dst)->u.t);
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_R20Parser__parser_ctx_t(struct _fx_R20Parser__parser_ctx_t* dst)
{
   fx_free_str(&dst->filename);
   fx_free_list_simple(&dst->deps);
   _fx_free_LS(&dst->inc_dirs);
}

static void _fx_copy_R20Parser__parser_ctx_t(struct _fx_R20Parser__parser_ctx_t* src, struct _fx_R20Parser__parser_ctx_t* dst)
{
   dst->m_idx = src->m_idx;
   fx_copy_str(&src->filename, &dst->filename);
   FX_COPY_PTR(src->deps, &dst->deps);
   FX_COPY_PTR(src->inc_dirs, &dst->inc_dirs);
   dst->default_loc = src->default_loc;
}

static void _fx_make_R20Parser__parser_ctx_t(
   int_ r_m_idx,
   fx_str_t* r_filename,
   struct _fx_Li_data_t* r_deps,
   struct _fx_LS_data_t* r_inc_dirs,
   struct _fx_R10Ast__loc_t* r_default_loc,
   struct _fx_R20Parser__parser_ctx_t* fx_result)
{
   fx_result->m_idx = r_m_idx;
   fx_copy_str(r_filename, &fx_result->filename);
   FX_COPY_PTR(r_deps, &fx_result->deps);
   FX_COPY_PTR(r_inc_dirs, &fx_result->inc_dirs);
   fx_result->default_loc = *r_default_loc;
}

static void _fx_free_T2LN10Ast__pat_tN10Ast__exp_t(struct _fx_T2LN10Ast__pat_tN10Ast__exp_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2LN10Ast__pat_tN10Ast__exp_t* src,
   struct _fx_T2LN10Ast__pat_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__pat_tN10Ast__exp_t(
   struct _fx_LN10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2LN10Ast__pat_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN10Ast__pat_tLN10Ast__exp_t(struct _fx_T2LN10Ast__pat_tLN10Ast__exp_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__pat_tLN10Ast__exp_t(
   struct _fx_T2LN10Ast__pat_tLN10Ast__exp_t* src,
   struct _fx_T2LN10Ast__pat_tLN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__pat_tLN10Ast__exp_t(
   struct _fx_LN10Ast__pat_t_data_t* t0,
   struct _fx_LN10Ast__exp_t_data_t* t1,
   struct _fx_T2LN10Ast__pat_tLN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t* src,
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   dst->t3 = src->t3;
}

static void _fx_make_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_R16Ast__for_flags_t* t2,
   struct _fx_R10Ast__loc_t* t3,
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   fx_result->t3 = *t3;
}

static void _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t,
      _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t);
}

static int _fx_cons_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t* hd,
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t,
      _fx_copy_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t);
}

static void _fx_free_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t* dst)
{
   _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t* src,
   struct _fx_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t(
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t(
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t* src,
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
}

static void _fx_make_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_R16Ast__for_flags_t* t3,
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = *t3;
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t2);
   _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&dst->t3);
}

static void _fx_copy_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t* src,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   FX_COPY_PTR(src->t3, &dst->t3);
}

static void _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   bool t1,
   struct _fx_LN10Ast__exp_t_data_t* t2,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* t3,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   FX_COPY_PTR(t3, &fx_result->t3);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   fx_free_str(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tS(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tS(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   fx_str_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_copy_str(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t* src,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T3N13Ast__binary_tiN15Ast__op_assoc_t(struct _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t* dst)
{
   _fx_free_N13Ast__binary_t(&dst->t0);
}

static void _fx_copy_T3N13Ast__binary_tiN15Ast__op_assoc_t(
   struct _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t* src,
   struct _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
}

static void _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(
   struct _fx_N13Ast__binary_t_data_t* t0,
   int_ t1,
   struct _fx_N15Ast__op_assoc_t* t2,
   struct _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(struct _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_LN10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_LN10Ast__exp_t_data_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T2N10Ast__exp_tLN10Ast__exp_t(struct _fx_T2N10Ast__exp_tLN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2N10Ast__exp_tLN10Ast__exp_t(
   struct _fx_T2N10Ast__exp_tLN10Ast__exp_t* src,
   struct _fx_T2N10Ast__exp_tLN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N10Ast__exp_tLN10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__exp_tLN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LN10Ast__exp_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LNt6option1N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LNt6option1N10Ast__exp_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LT2iR9Ast__id_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLS(struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LS(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLS(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLS(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LS_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__exp_t(&dst->t0);
   _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_LN10Ast__exp_t_data_t* t0,
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t* t1,
   struct _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* dst)
{
   _fx_free_LN10Ast__exp_t(&dst->t0);
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t1);
   _fx_free_N10Ast__pat_t(&dst->t2);
}

static void _fx_copy_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* src,
   struct _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_LN10Ast__exp_t_data_t* t0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1,
   struct _fx_N10Ast__pat_t_data_t* t2,
   struct _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t* src,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tB(struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tB* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tB* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   bool t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
}

static void _fx_free_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB(
   struct _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LN10Ast__pat_t(&dst->t1);
   _fx_free_N10Ast__typ_t(&dst->t2);
   _fx_free_LN10Ast__exp_t(&dst->t3);
}

static void _fx_copy_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB(
   struct _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB* src,
   struct _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   FX_COPY_PTR(src->t3, &dst->t3);
   dst->t4 = src->t4;
}

static void _fx_make_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LN10Ast__pat_t_data_t* t1,
   struct _fx_N10Ast__typ_t_data_t* t2,
   struct _fx_LN10Ast__exp_t_data_t* t3,
   bool t4,
   struct _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   FX_COPY_PTR(t3, &fx_result->t3);
   fx_result->t4 = t4;
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
}

static void _fx_make_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_R10Ast__loc_t* t3,
   struct _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = *t3;
}

static void _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t,
      _fx_free_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t);
}

static int _fx_cons_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* hd,
   struct _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t,
      _fx_copy_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t);
}

static void _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LN10Ast__pat_t(&dst->t1);
   _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LN10Ast__pat_t_data_t* t1,
   struct _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t_data_t* t2,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t(
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LN10Ast__pat_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t(
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t* src,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
}

static void _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LN10Ast__pat_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_R16Ast__fun_flags_t* t3,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = *t3;
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LN10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LN10Ast__pat_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t(
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   fx_free_str(&dst->t2);
   _fx_free_R16Ast__val_flags_t(&dst->t3);
}

static void _fx_copy_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t(
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t* src,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   fx_copy_str(&src->t2, &dst->t2);
   _fx_copy_R16Ast__val_flags_t(&src->t3, &dst->t3);
}

static void _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   bool t1,
   fx_str_t* t2,
   struct _fx_R16Ast__val_flags_t* t3,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
   fx_copy_str(t2, &fx_result->t2);
   _fx_copy_R16Ast__val_flags_t(t3, &fx_result->t3);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_ti(struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_ti* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_ti(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_ti* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_ti* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_ti(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   int_ t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_ti* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
}

static void _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
}

static void _fx_copy_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
}

static void _fx_make_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = *t2;
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* dst)
{
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&dst->t0);
   _fx_free_N15Parser__ppval_t(&dst->t1);
}

static void _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* src,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_N15Parser__ppval_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* t0,
   struct _fx_N15Parser__ppval_t* t1,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_N15Parser__ppval_t(t1, &fx_result->t1);
}

static void _fx_free_rNt10Hashmap__t2SN15Parser__ppval_t(struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rNt10Hashmap__t2SN15Parser__ppval_t, _fx_free_Nt10Hashmap__t2SN15Parser__ppval_t);
}

static int _fx_make_rNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t* arg,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rNt10Hashmap__t2SN15Parser__ppval_t, FX_COPY_PTR);
}

_fx_Nt6option1N15Parser__ppval_t _fx_g12Parser__None = { 1 };
_fx_Nt6option1R9Ast__id_t _fx_g14Parser__None1_ = { 1 };
_fx_Nt6option1N10Ast__exp_t _fx_g14Parser__None2_ = 0;
_fx_Nt6option1N10Ast__typ_t _fx_g14Parser__None3_ = 0;
_fx_N10Ast__lit_t _fx_g16Parser__LitEmpty = { 8 };
static _fx_N10Ast__typ_t_data_t TypVarRecord_data_0 = { 1, 4 };
_fx_N10Ast__typ_t _fx_g20Parser__TypVarRecord = &TypVarRecord_data_0;
static _fx_N10Ast__typ_t_data_t TypInt_data_1 = { 1, 5 };
_fx_N10Ast__typ_t _fx_g14Parser__TypInt = &TypInt_data_1;
static _fx_N10Ast__typ_t_data_t TypLong_data_0 = { 1, 8 };
_fx_N10Ast__typ_t _fx_g15Parser__TypLong = &TypLong_data_0;
static _fx_N10Ast__typ_t_data_t TypString_data_1 = { 1, 10 };
_fx_N10Ast__typ_t _fx_g17Parser__TypString = &TypString_data_1;
static _fx_N10Ast__typ_t_data_t TypChar_data_1 = { 1, 11 };
_fx_N10Ast__typ_t _fx_g15Parser__TypChar = &TypChar_data_1;
static _fx_N10Ast__typ_t_data_t TypBool_data_1 = { 1, 12 };
_fx_N10Ast__typ_t _fx_g15Parser__TypBool = &TypBool_data_1;
static _fx_N10Ast__typ_t_data_t TypVoid_data_1 = { 1, 13 };
_fx_N10Ast__typ_t _fx_g15Parser__TypVoid = &TypVoid_data_1;
static _fx_N10Ast__typ_t_data_t TypExn_data_0 = { 1, 21 };
_fx_N10Ast__typ_t _fx_g14Parser__TypExn = &TypExn_data_0;
static _fx_N10Ast__typ_t_data_t TypCPointer_data_1 = { 1, 23 };
_fx_N10Ast__typ_t _fx_g19Parser__TypCPointer = &TypCPointer_data_1;
_fx_N15Ast__op_assoc_t _fx_g17Parser__AssocLeft = { 1 };
_fx_N15Ast__op_assoc_t _fx_g18Parser__AssocRight = { 2 };
_fx_N12Ast__cmpop_t _fx_g13Parser__CmpEQ = { 1 };
static _fx_N13Ast__binary_t_data_t OpAdd_data_1 = { 1, 1 };
_fx_N13Ast__binary_t _fx_g13Parser__OpAdd = &OpAdd_data_1;
static _fx_N13Ast__binary_t_data_t OpSub_data_1 = { 1, 2 };
_fx_N13Ast__binary_t _fx_g13Parser__OpSub = &OpSub_data_1;
static _fx_N13Ast__binary_t_data_t OpMul_data_2 = { 1, 3 };
_fx_N13Ast__binary_t _fx_g13Parser__OpMul = &OpMul_data_2;
static _fx_N13Ast__binary_t_data_t OpDiv_data_2 = { 1, 4 };
_fx_N13Ast__binary_t _fx_g13Parser__OpDiv = &OpDiv_data_2;
static _fx_N13Ast__binary_t_data_t OpRDiv_data_0 = { 1, 5 };
_fx_N13Ast__binary_t _fx_g14Parser__OpRDiv = &OpRDiv_data_0;
static _fx_N13Ast__binary_t_data_t OpMod_data_2 = { 1, 6 };
_fx_N13Ast__binary_t _fx_g13Parser__OpMod = &OpMod_data_2;
static _fx_N13Ast__binary_t_data_t OpPow_data_1 = { 1, 7 };
_fx_N13Ast__binary_t _fx_g13Parser__OpPow = &OpPow_data_1;
static _fx_N13Ast__binary_t_data_t OpShiftLeft_data_1 = { 1, 8 };
_fx_N13Ast__binary_t _fx_g19Parser__OpShiftLeft = &OpShiftLeft_data_1;
static _fx_N13Ast__binary_t_data_t OpShiftRight_data_1 = { 1, 9 };
_fx_N13Ast__binary_t _fx_g20Parser__OpShiftRight = &OpShiftRight_data_1;
static _fx_N13Ast__binary_t_data_t OpDotAdd_data_0 = { 1, 10 };
_fx_N13Ast__binary_t _fx_g16Parser__OpDotAdd = &OpDotAdd_data_0;
static _fx_N13Ast__binary_t_data_t OpDotSub_data_0 = { 1, 11 };
_fx_N13Ast__binary_t _fx_g16Parser__OpDotSub = &OpDotSub_data_0;
static _fx_N13Ast__binary_t_data_t OpDotMul_data_1 = { 1, 12 };
_fx_N13Ast__binary_t _fx_g16Parser__OpDotMul = &OpDotMul_data_1;
static _fx_N13Ast__binary_t_data_t OpDotDiv_data_1 = { 1, 13 };
_fx_N13Ast__binary_t _fx_g16Parser__OpDotDiv = &OpDotDiv_data_1;
static _fx_N13Ast__binary_t_data_t OpDotMod_data_1 = { 1, 14 };
_fx_N13Ast__binary_t _fx_g16Parser__OpDotMod = &OpDotMod_data_1;
static _fx_N13Ast__binary_t_data_t OpDotPow_data_0 = { 1, 15 };
_fx_N13Ast__binary_t _fx_g16Parser__OpDotPow = &OpDotPow_data_0;
static _fx_N13Ast__binary_t_data_t OpBitwiseAnd_data_1 = { 1, 16 };
_fx_N13Ast__binary_t _fx_g20Parser__OpBitwiseAnd = &OpBitwiseAnd_data_1;
static _fx_N13Ast__binary_t_data_t OpLogicAnd_data_0 = { 1, 17 };
_fx_N13Ast__binary_t _fx_g18Parser__OpLogicAnd = &OpLogicAnd_data_0;
static _fx_N13Ast__binary_t_data_t OpBitwiseOr_data_1 = { 1, 18 };
_fx_N13Ast__binary_t _fx_g19Parser__OpBitwiseOr = &OpBitwiseOr_data_1;
static _fx_N13Ast__binary_t_data_t OpLogicOr_data_0 = { 1, 19 };
_fx_N13Ast__binary_t _fx_g17Parser__OpLogicOr = &OpLogicOr_data_0;
static _fx_N13Ast__binary_t_data_t OpBitwiseXor_data_1 = { 1, 20 };
_fx_N13Ast__binary_t _fx_g20Parser__OpBitwiseXor = &OpBitwiseXor_data_1;
static _fx_N13Ast__binary_t_data_t OpSpaceship_data_1 = { 1, 23 };
_fx_N13Ast__binary_t _fx_g19Parser__OpSpaceship = &OpSpaceship_data_1;
static _fx_N13Ast__binary_t_data_t OpDotSpaceship_data_0 = { 1, 24 };
_fx_N13Ast__binary_t _fx_g22Parser__OpDotSpaceship = &OpDotSpaceship_data_0;
static _fx_N13Ast__binary_t_data_t OpSame_data_0 = { 1, 25 };
_fx_N13Ast__binary_t _fx_g14Parser__OpSame = &OpSame_data_0;
static _fx_N13Ast__binary_t_data_t OpCons_data_0 = { 1, 26 };
_fx_N13Ast__binary_t _fx_g14Parser__OpCons = &OpCons_data_0;
_fx_N12Ast__unary_t _fx_g14Parser__OpPlus = { 1 };
_fx_N12Ast__unary_t _fx_g16Parser__OpNegate = { 2 };
_fx_N12Ast__unary_t _fx_g18Parser__OpDotMinus = { 3 };
_fx_N12Ast__unary_t _fx_g20Parser__OpBitwiseNot = { 4 };
_fx_N12Ast__unary_t _fx_g18Parser__OpLogicNot = { 5 };
_fx_N12Ast__unary_t _fx_g15Parser__OpMkRef = { 6 };
_fx_N12Ast__unary_t _fx_g15Parser__OpDeref = { 7 };
_fx_N12Ast__unary_t _fx_g16Parser__OpExpand = { 8 };
_fx_N12Ast__unary_t _fx_g14Parser__OpApos = { 9 };
_fx_N12Ast__sctyp_t _fx_g15Parser__ScUInt8 = { 1 };
_fx_N12Ast__sctyp_t _fx_g14Parser__ScInt8 = { 2 };
_fx_N12Ast__sctyp_t _fx_g16Parser__ScUInt16 = { 3 };
_fx_N12Ast__sctyp_t _fx_g15Parser__ScInt16 = { 4 };
_fx_N13Ast__intrin_t _fx_g21Parser__IntrinGetSize = { 9 };
_fx_N13Ast__intrin_t _fx_g18Parser__IntrinGEMM = { 13 };
_fx_N15Ast__for_make_t _fx_g19Parser__ForMakeNone = { 1 };
_fx_N15Ast__for_make_t _fx_g20Parser__ForMakeArray = { 2 };
_fx_N15Ast__for_make_t _fx_g19Parser__ForMakeList = { 3 };
_fx_N15Ast__for_make_t _fx_g21Parser__ForMakeVector = { 4 };
_fx_N15Ast__for_make_t _fx_g20Parser__ForMakeTuple = { 5 };
_fx_N13Ast__border_t _fx_g18Parser__BorderNone = { 1 };
_fx_N18Ast__interpolate_t _fx_g18Parser__InterpNone = { 1 };
_fx_N14Lexer__token_t _fx_g14Parser__RPAREN = { 46 };
_fx_N14Lexer__token_t _fx_g15Parser__RSQUARE = { 48 };
_fx_N14Lexer__token_t _fx_g14Parser__RBRACE = { 50 };
int _FX_EXN_E18Parser__ParseError = 0;
_fx_N17Parser__kw_mode_t _fx_g14Parser__KwNone = { 1 };
_fx_N17Parser__kw_mode_t _fx_g15Parser__KwMaybe = { 2 };
_fx_N17Parser__kw_mode_t _fx_g14Parser__KwMust = { 3 };
_fx_N19Parser__ppifstate_t _fx_g18Parser__PP_BR_TRUE = { 1 };
_fx_R20Parser__parser_ctx_t _fx_g18Parser__parser_ctx = {0};
FX_EXTERN_C bool _fx_F6__eq__B2SS(fx_str_t* a, fx_str_t* b, void* fx_fv);

FX_EXTERN_C void _fx_F12print_stringv1S(fx_str_t* a, void* fx_fv);

FX_EXTERN_C int _fx_M7HashmapFM9makeindexA1i1i(int_ size_0, fx_arr_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_F9make_FailE1S(fx_str_t* arg0, fx_exn_t* fx_result);

FX_EXTERN_C uint64_t _fx_F4hashq1S(fx_str_t* x, void* fx_fv);

FX_EXTERN_C int _fx_F6assertv1B(bool f_0, void* fx_fv);

FX_EXTERN_C int _fx_M7HashsetFM9makeindexA1i1i(int_ size_0, fx_arr_t* fx_result, void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_R10Ast__loc_t _fx_g10Ast__noloc)
FX_EXTERN_C int _fx_M3AstFM2ppS1RM4id_t(struct _fx_R9Ast__id_t* i_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M6StringFM5splitLS3SCB(
   fx_str_t* s_0,
   char_ c_0,
   bool allow_empty_0,
   struct _fx_LS_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M8FilenameFM7dir_sepS0(fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M6StringFM7replaceS3SSS(
   fx_str_t* s,
   fx_str_t* substr,
   fx_str_t* new_substr,
   fx_str_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M8FilenameFM6locateS2SLS(fx_str_t* name_0, struct _fx_LS_data_t* dirs_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C_VAL(int FX_EXN_NotFoundError)
FX_EXTERN_C int _fx_M8FilenameFM6concatS2SS(fx_str_t* dir_0, fx_str_t* fname_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6stringS1RM4id_t(struct _fx_R9Ast__id_t* i_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M8FilenameFM7dirnameS1S(fx_str_t* path_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_Nt10Hashset__t1S_data_t* _fx_g19Ast__all_c_inc_dirs)
FX_EXTERN_C int _fx_M3AstFM11find_modulei2RM4id_tS(
   struct _fx_R9Ast__id_t* mname_0,
   fx_str_t* mfname_0,
   int_* fx_result,
   void* fx_fv);

FX_EXTERN_C bool _fx_M6StringFM8containsB2SC(fx_str_t* s, char_ c, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(
   struct _fx_R10Ast__loc_t* l_0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N12Ast__unary_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11get_lit_typN10Ast__typ_t1N10Ast__lit_t(
   struct _fx_N10Ast__lit_t* l_0,
   struct _fx_N10Ast__typ_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6ExpLitN10Ast__exp_t2N10Ast__lit_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__lit_t* arg0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6get_idRM4id_t1S(fx_str_t* s_0, struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM10ExpMkTupleN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_LN10Ast__exp_t_data_t* arg0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6gen_idRM4id_t2iS(int_ m_idx_0, fx_str_t* s_0, struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM8PatTypedN10Ast__pat_t3N10Ast__pat_tN10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__pat_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM5PatAsN10Ast__pat_t3N10Ast__pat_tRM4id_tRM5loc_t(
   struct _fx_N10Ast__pat_t_data_t* arg0,
   struct _fx_R9Ast__id_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C_VAL(struct _fx_R9Ast__id_t _fx_g23Ast__std__fold_result__)
FX_EXTERN_C int _fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11get_end_locRM5loc_t1RM5loc_t(
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM17default_var_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(
   struct _fx_N10Ast__pat_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_R16Ast__val_flags_t* arg2,
   struct _fx_R10Ast__loc_t* arg3,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM9ExpAssignN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_LN10Ast__exp_t_data_t* arg0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C void _fx_M3AstFM7LitBoolN10Ast__lit_t1B(bool arg0, struct _fx_N10Ast__lit_t* fx_result);

FX_EXTERN_C int _fx_M3AstFM8ExpBreakN10Ast__exp_t2BRM5loc_t(
   bool arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM5ExpIfN10Ast__exp_t4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_N10Ast__exp_t_data_t* arg2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg3,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM7ExpCallN10Ast__exp_t3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_LN10Ast__exp_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM10PatVariantN10Ast__pat_t3RM4id_tLN10Ast__pat_tRM5loc_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_LN10Ast__pat_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6PatAnyN10Ast__pat_t1RM5loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM8ExpThrowN10Ast__exp_t2N10Ast__exp_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM12make_new_typN10Ast__typ_t0(struct _fx_N10Ast__typ_t_data_t** fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM8ExpMatchN10Ast__exp_t3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11ExpContinueN10Ast__exp_t1RM5loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6ExpForN10Ast__exp_t5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tRM11for_flags_tRM5loc_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* arg0,
   struct _fx_N10Ast__pat_t_data_t* arg1,
   struct _fx_N10Ast__exp_t_data_t* arg2,
   struct _fx_R16Ast__for_flags_t* arg3,
   struct _fx_R10Ast__loc_t* arg4,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M3AstFM6ExpMapN10Ast__exp_t4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tRM11for_flags_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_R16Ast__for_flags_t* arg2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg3,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(
   struct _fx_LR10Ast__loc_t_data_t* llist_0,
   struct _fx_R10Ast__loc_t* default_loc_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(
   struct _fx_N14Lexer__token_t* t_0,
   struct _fx_Ta2S* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6stringS1RM5loc_t(struct _fx_R10Ast__loc_t* loc_0, fx_str_t* fx_result, void* fx_fv);

static int
   _fx_M6ParserFM15parse_exp_list_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t9LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tN14Lexer__token_tN17Parser__kw_mode_tFPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_tBLT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LN10Ast__exp_t_data_t* el_0,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* kw_el_0,
   struct _fx_N14Lexer__token_t* ct_0,
   struct _fx_N17Parser__kw_mode_t* kw_mode_0,
   struct _fx_FPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t* parse_exp_f_0,
   bool stop_at_semicolon_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts0_0,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6ParserFM15parse_typed_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM9ExpBinaryN10Ast__exp_t4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N13Ast__binary_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_N10Ast__exp_t_data_t* arg2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg3,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6ParserFM10get_opnameR9Ast__id_t1N14Lexer__token_t(
   struct _fx_N14Lexer__token_t* t_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_R9Ast__id_t _fx_g9Ast__noid)
FX_EXTERN_C int _fx_M3AstFM6__eq__B2RM4id_tRM4id_t(
   struct _fx_R9Ast__id_t* a_0,
   struct _fx_R9Ast__id_t* b_0,
   bool* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6ParserFM10parse_syncT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6ParserFM9parse_forT3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN15Ast__for_make_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N15Ast__for_make_t* for_make_0,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM10ExpMkArrayN10Ast__exp_t2LLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_LLN10Ast__exp_t_data_t* arg0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M6ParserFM15parse_range_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts0_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

static int
   _fx_M6ParserFM18extend_simple_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N10Ast__exp_t_data_t* e_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11ExpMkRecordN10Ast__exp_t3N10Ast__exp_tLT2RM4id_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C bool _fx_M6StringFM10startswithB2SS(fx_str_t* s, fx_str_t* prefix, void* fx_fv);

FX_EXTERN_C void _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N13Ast__intrin_t* fx_result);

FX_EXTERN_C void _fx_M3AstFM14IntrinSaturateN13Ast__intrin_t1N12Ast__sctyp_t(
   struct _fx_N12Ast__sctyp_t* arg0,
   struct _fx_N13Ast__intrin_t* fx_result);

FX_EXTERN_C int _fx_M3AstFM9ExpIntrinN10Ast__exp_t3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N13Ast__intrin_t* arg0,
   struct _fx_LN10Ast__exp_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11ExpMkVectorN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_LN10Ast__exp_t_data_t* arg0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M3AstFM5ExpAtN10Ast__exp_t5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_N13Ast__border_t* arg1,
   struct _fx_N18Ast__interpolate_t* arg2,
   struct _fx_LN10Ast__exp_t_data_t* arg3,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg4,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C void _fx_M3AstFM6LitIntN10Ast__lit_t1l(int64_t arg0, struct _fx_N10Ast__lit_t* fx_result);

FX_EXTERN_C int _fx_M3AstFM6ExpMemN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM15ExpUpdateRecordN10Ast__exp_t3N10Ast__exp_tLT2RM4id_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

static int
   _fx_M6ParserFM17parse_binary_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tiB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N10Ast__exp_t_data_t* result_0,
   int_ min_prec_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM8OpDotCmpN13Ast__binary_t1N12Ast__cmpop_t(
   struct _fx_N12Ast__cmpop_t* arg0,
   struct _fx_N13Ast__binary_t_data_t** fx_result);

static int
   _fx_M6ParserFM18parse_chained_cmp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

static int
   _fx_M6ParserFM16parse_logic_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tiB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N10Ast__exp_t_data_t* result_0,
   int_ min_prec_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM5OpCmpN13Ast__binary_t1N12Ast__cmpop_t(
   struct _fx_N12Ast__cmpop_t* arg0,
   struct _fx_N13Ast__binary_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M6ParserFM12parse_expseqT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool toplevel_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM7ExpSyncN10Ast__exp_t2RM4id_tN10Ast__exp_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM8ExpCCodeN10Ast__exp_t2ST2N10Ast__typ_tRM5loc_t(
   fx_str_t* arg0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

static int
   _fx_M6ParserFM12parse_range_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLNt6option1N10Ast__exp_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_sep_0,
   struct _fx_LNt6option1N10Ast__exp_t_data_t* result_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M3AstFM8ExpRangeN10Ast__exp_t4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* arg0,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* arg1,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* arg2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg3,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_F6stringS1i(int_ a, fx_str_t* fx_result, void* fx_fv);

static int
   _fx_M6ParserFM14extend_expseq_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_LN10Ast__exp_t_data_t* result_0,
   bool toplevel_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6ParserFM13parse_defvalsT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6ParserFM13parse_deftypeT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6ParserFM11parse_ifaceT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6ParserFM12parse_lambdaT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6ParserFM11parse_defunT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6DefExnN10Ast__exp_t1rRM8defexn_t(
   struct _fx_rR13Ast__defexn_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM9DirImportN10Ast__exp_t2LT2iRM4id_tRM5loc_t(
   struct _fx_LT2iR9Ast__id_t_data_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM13DirImportFromN10Ast__exp_t3iLRM4id_tRM5loc_t(
   int_ arg0,
   struct _fx_LR9Ast__id_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM9DirPragmaN10Ast__exp_t2LSRM5loc_t(
   struct _fx_LS_data_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M6ParserFM10parse_stmtT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool simple_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int
   _fx_M6ParserFM17parse_match_casesT2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM17default_for_flagsRM11for_flags_t0(struct _fx_R16Ast__for_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM8PatTupleN10Ast__pat_t2LN10Ast__pat_tRM5loc_t(
   struct _fx_LN10Ast__pat_t_data_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM17default_val_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

static int
   _fx_M6ParserFM15extend_defvals_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tR16Ast__val_flags_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LN10Ast__exp_t_data_t* result_0,
   struct _fx_R16Ast__val_flags_t* flags_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM7ExpDataN10Ast__exp_t3SST2N10Ast__typ_tRM5loc_t(
   fx_str_t* arg0,
   fx_str_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM13fname_op_aposRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12fname_op_addRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12fname_op_subRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12fname_op_mulRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM13fname_op_rdivRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12fname_op_divRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12fname_op_modRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12fname_op_powRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_dot_addRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_dot_subRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_dot_mulRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_dot_divRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_dot_modRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_dot_powRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12fname_op_shlRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12fname_op_shrRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_bit_andRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM15fname_op_bit_orRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_bit_xorRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_bit_notRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_aug_addRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_aug_subRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_aug_mulRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_aug_divRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_aug_modRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM20fname_op_aug_bit_andRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM19fname_op_aug_bit_orRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM20fname_op_aug_bit_xorRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM20fname_op_aug_dot_mulRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM20fname_op_aug_dot_divRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM20fname_op_aug_dot_modRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_aug_shlRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_aug_shrRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM12fname_op_cmpRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM13fname_op_sameRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11fname_op_eqRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11fname_op_neRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11fname_op_leRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11fname_op_geRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11fname_op_ltRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11fname_op_gtRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM16fname_op_dot_cmpRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM15fname_op_dot_eqRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM15fname_op_dot_neRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM15fname_op_dot_leRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM15fname_op_dot_geRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM15fname_op_dot_ltRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM15fname_op_dot_gtRM4id_t0(struct _fx_R9Ast__id_t* fx_result, void* fx_fv);

FX_EXTERN_C int_ _fx_M6StringFM5rfindi2SC(fx_str_t* s, char_ c, void* fx_fv);

FX_EXTERN_C int
   _fx_M6ParserFM16parse_fun_paramsT5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM17default_fun_flagsRM11fun_flags_t0(struct _fx_R16Ast__fun_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int
   _fx_M6ParserFM23parse_body_and_make_funT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t7LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tR16Ast__fun_flags_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_R9Ast__id_t* fname_0,
   struct _fx_LN10Ast__pat_t_data_t* params_0,
   struct _fx_N10Ast__typ_t_data_t* rt_0,
   struct _fx_LN10Ast__exp_t_data_t* prologue_0,
   struct _fx_R16Ast__fun_flags_t* fflags_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

static int
   _fx_M6ParserFM9parse_if_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R10Ast__loc_t* l1_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11ExpTryCatchN10Ast__exp_t3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM7dup_expN10Ast__exp_t1N10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_R9Ast__id_t _fx_g18Ast__std__lambda__)
FX_EXTERN_C int _fx_M3AstFM6dup_idRM4id_t2iRM4id_t(
   int_ m_idx_0,
   struct _fx_R9Ast__id_t* old_id_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM8ExpTypedN10Ast__exp_t3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM7ExpCastN10Ast__exp_t3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t* arg1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM17default_arg_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM9TypRecordN10Ast__typ_t1rT2LT4RM11val_flags_tRM4id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM9PatRecordN10Ast__pat_t3Nt6option1RM4id_tLT2RM4id_tN10Ast__pat_tRM5loc_t(
   struct _fx_Nt6option1R9Ast__id_t* arg0,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C_VAL(struct _fx_R9Ast__id_t _fx_g18Ast__std__kwargs__)
FX_EXTERN_C int _fx_M3AstFM6TypFunN10Ast__typ_t2LN10Ast__typ_tN10Ast__typ_t(
   struct _fx_LN10Ast__typ_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t* arg1,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C_VAL(struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t _fx_g14Ast__empty_env)
FX_EXTERN_C int _fx_M3AstFM6DefFunN10Ast__exp_t1rRM8deffun_t(
   struct _fx_rR13Ast__deffun_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM9ExpReturnN10Ast__exp_t2Nt6option1N10Ast__exp_tRM5loc_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM8ExpWhileN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM10ExpDoWhileN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tRM5loc_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11OpAugBinaryN13Ast__binary_t1N13Ast__binary_t(
   struct _fx_N13Ast__binary_t_data_t* arg0,
   struct _fx_N13Ast__binary_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6PatLitN10Ast__pat_t2N10Ast__lit_tRM5loc_t(
   struct _fx_N10Ast__lit_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM7PatConsN10Ast__pat_t3N10Ast__pat_tN10Ast__pat_tRM5loc_t(
   struct _fx_N10Ast__pat_t_data_t* arg0,
   struct _fx_N10Ast__pat_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6PatRefN10Ast__pat_t2N10Ast__pat_tRM5loc_t(
   struct _fx_N10Ast__pat_t_data_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM7PatWhenN10Ast__pat_t3N10Ast__pat_tN10Ast__exp_tRM5loc_t(
   struct _fx_N10Ast__pat_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6PatAltN10Ast__pat_t2LN10Ast__pat_tRM5loc_t(
   struct _fx_LN10Ast__pat_t_data_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N10Ast__pat_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM8TypFloatN10Ast__typ_t1i(int_ arg0, struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM7TypSIntN10Ast__typ_t1i(int_ arg0, struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM7TypUIntN10Ast__typ_t1i(int_ arg0, struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6TypAppN10Ast__typ_t2LN10Ast__typ_tRM4id_t(
   struct _fx_LN10Ast__typ_t_data_t* arg0,
   struct _fx_R9Ast__id_t* arg1,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int
   _fx_M6ParserFM15parse_typtuple_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__typ_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LN10Ast__typ_t_data_t* result_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6TypVarN10Ast__typ_t1rNt6option1N10Ast__typ_t(
   struct _fx_rNt6option1N10Ast__typ_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM7TypListN10Ast__typ_t1N10Ast__typ_t(
   struct _fx_N10Ast__typ_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM9TypVectorN10Ast__typ_t1N10Ast__typ_t(
   struct _fx_N10Ast__typ_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6TypRefN10Ast__typ_t1N10Ast__typ_t(
   struct _fx_N10Ast__typ_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11TypVarArrayN10Ast__typ_t1N10Ast__typ_t(
   struct _fx_N10Ast__typ_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM8TypArrayN10Ast__typ_t2iN10Ast__typ_t(
   int_ arg0,
   struct _fx_N10Ast__typ_t_data_t* arg1,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM11TypVarTupleN10Ast__typ_t1Nt6option1N10Ast__typ_t(
   struct _fx_Nt6option1N10Ast__typ_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM8TypTupleN10Ast__typ_t1LN10Ast__typ_t(
   struct _fx_LN10Ast__typ_t_data_t* arg0,
   struct _fx_N10Ast__typ_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM21default_variant_flagsRM11var_flags_t0(struct _fx_R16Ast__var_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM10DefVariantN10Ast__exp_t1rRM12defvariant_t(
   struct _fx_rR17Ast__defvariant_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM6DefTypN10Ast__exp_t1rRM8deftyp_t(
   struct _fx_rR13Ast__deftyp_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

FX_EXTERN_C int _fx_M3AstFM12DefInterfaceN10Ast__exp_t1rRM14definterface_t(
   struct _fx_rR19Ast__definterface_t_data_t* arg0,
   struct _fx_N10Ast__exp_t_data_t** fx_result);

static int
   _fx_M6ParserFM6ppnextLT2N14Lexer__token_tR10Ast__loc_t4LT2N14Lexer__token_tR10Ast__loc_tLT2N19Parser__ppifstate_tR10Ast__loc_tLT2N14Lexer__token_tR10Ast__loc_trNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t_data_t* ppstack_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* result_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t** fx_result,
   void* fx_fv);

static int
   _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_F6stringS1B(bool a_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_F6stringS1l(int64_t a, fx_str_t* fx_result, void* fx_fv);

static int
   _fx_M6ParserFM10pp_binary_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t5LT2N14Lexer__token_tR10Ast__loc_tBN15Parser__ppval_tirNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   struct _fx_N15Parser__ppval_t* result_0,
   int_ min_prec_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_F7__cmp__i2ll(int64_t a_0, int64_t b_0, int_* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_F7__cmp__i2BB(bool a_0, bool b_0, int_* fx_result, void* fx_fv);

FX_EXTERN_C int_ _fx_F7__cmp__i2SS(fx_str_t* a, fx_str_t* b, void* fx_fv);

FX_EXTERN_C void _fx_M5LexerFM7LITERALN14Lexer__token_t1N10Ast__lit_t(
   struct _fx_N10Ast__lit_t* arg0,
   struct _fx_N14Lexer__token_t* fx_result);

FX_EXTERN_C void _fx_M3AstFM9LitStringN10Ast__lit_t1S(fx_str_t* arg0, struct _fx_N10Ast__lit_t* fx_result);

FX_EXTERN_C_VAL(fx_arr_t _fx_g16Ast__all_modules)
FX_EXTERN_C int _fx_M10LexerUtilsFM11make_streamN20LexerUtils__stream_t1S(
   fx_str_t* fname_0,
   struct _fx_N20LexerUtils__stream_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C_VAL(int FX_EXN_FileOpenError)
FX_EXTERN_C_VAL(int FX_EXN_IOError)
FX_EXTERN_C int _fx_M5LexerFM10make_lexerFPLT2N14Lexer__token_tTa2i01N20LexerUtils__stream_t(
   struct _fx_N20LexerUtils__stream_t_data_t* strm_0,
   struct _fx_FPLT2N14Lexer__token_tTa2i0* fx_result,
   void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_R18Options__options_t _fx_g12Options__opt)
fx_exn_info_t _fx_E18Parser__ParseError_info = {0};
typedef struct {
   int_ rc;
   struct _fx_T2R10Ast__loc_tS data;
} _fx_E18Parser__ParseError_data_t;

FX_EXTERN_C void _fx_free_E18Parser__ParseError(_fx_E18Parser__ParseError_data_t* dst)
{
   _fx_free_T2R10Ast__loc_tS(&dst->data);
   fx_free(dst);
}

FX_EXTERN_C void _fx_M6ParserFM4SomeNt6option1N15Parser__ppval_t1N15Parser__ppval_t(
   struct _fx_N15Parser__ppval_t* arg0,
   struct _fx_Nt6option1N15Parser__ppval_t* fx_result)
{
   fx_result->tag = 2;
   _fx_copy_N15Parser__ppval_t(arg0, &fx_result->u.Some);
}

FX_EXTERN_C void _fx_M6ParserFM4SomeNt6option1R9Ast__id_t1R9Ast__id_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_Nt6option1R9Ast__id_t* fx_result)
{
   fx_result->tag = 2;
   fx_result->u.Some = *arg0;
}

FX_EXTERN_C int _fx_M6ParserFM4SomeNt6option1N10Ast__exp_t1N10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* arg0,
   struct _fx_Nt6option1N10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt6option1N10Ast__exp_t);
   FX_COPY_PTR(arg0, &v->u.Some);
   return 0;
}

FX_EXTERN_C int _fx_M6ParserFM4SomeNt6option1N10Ast__typ_t1N10Ast__typ_t(
   struct _fx_N10Ast__typ_t_data_t* arg0,
   struct _fx_Nt6option1N10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt6option1N10Ast__typ_t);
   FX_COPY_PTR(arg0, &v->u.Some);
   return 0;
}

FX_EXTERN_C int_ _fx_M6ParserFM6lengthi1LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t* l,
   void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C int_ _fx_M6ParserFM6lengthi1LNt6option1N10Ast__exp_t(struct _fx_LNt6option1N10Ast__exp_t_data_t* l, void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C int_ _fx_M6ParserFM6lengthi1LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(
   struct _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t_data_t* l,
   void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C int_ _fx_M6ParserFM6lengthi1LS(struct _fx_LS_data_t* l, void* fx_fv)
{
   
return fx_list_length(l);

}

FX_EXTERN_C void _fx_M6ParserFM5link2LN10Ast__typ_t2LN10Ast__typ_tLN10Ast__typ_t(
   struct _fx_LN10Ast__typ_t_data_t* l1,
   struct _fx_LN10Ast__typ_t_data_t* l2,
   struct _fx_LN10Ast__typ_t_data_t** fx_result,
   void* fx_fv)
{
   
fx_link_lists(l1, l2, fx_result);

}

FX_EXTERN_C void _fx_M6ParserFM5link2LN10Ast__pat_t2LN10Ast__pat_tLN10Ast__pat_t(
   struct _fx_LN10Ast__pat_t_data_t* l1,
   struct _fx_LN10Ast__pat_t_data_t* l2,
   struct _fx_LN10Ast__pat_t_data_t** fx_result,
   void* fx_fv)
{
   
fx_link_lists(l1, l2, fx_result);

}

FX_EXTERN_C void _fx_M6ParserFM5link2LN10Ast__exp_t2LN10Ast__exp_tLN10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* l1,
   struct _fx_LN10Ast__exp_t_data_t* l2,
   struct _fx_LN10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   
fx_link_lists(l1, l2, fx_result);

}

FX_EXTERN_C int _fx_M6ParserFM7__add__LN10Ast__exp_t2LN10Ast__exp_tLN10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* l1_0,
   struct _fx_LN10Ast__exp_t_data_t* l2_0,
   struct _fx_LN10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (l1_0 == 0) {
      FX_COPY_PTR(l2_0, fx_result);
   }
   else if (l2_0 == 0) {
      FX_COPY_PTR(l1_0, fx_result);
   }
   else {
      _fx_LN10Ast__exp_t v_0 = 0;
      _fx_LN10Ast__exp_t lstend_0 = 0;
      _fx_LN10Ast__exp_t lst_0 = l1_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_N10Ast__exp_t x_0 = lst_0->hd;
         _fx_LN10Ast__exp_t node_0 = 0;
         FX_CALL(_fx_cons_LN10Ast__exp_t(x_0, 0, false, &node_0), _fx_catch_0);
         FX_LIST_APPEND(v_0, lstend_0, node_0);

      _fx_catch_0: ;
         FX_CHECK_EXN(_fx_catch_1);
      }
      _fx_M6ParserFM5link2LN10Ast__exp_t2LN10Ast__exp_tLN10Ast__exp_t(v_0, l2_0, fx_result, 0);

   _fx_catch_1: ;
      if (v_0) {
         _fx_free_LN10Ast__exp_t(&v_0);
      }
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM6stringS1S(fx_str_t* a_0, fx_str_t* fx_result, void* fx_fv)
{
   int fx_status = 0;
   fx_copy_str(a_0, fx_result);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM15__eq_variants__B2N13Ast__binary_tN13Ast__binary_t(
   struct _fx_N13Ast__binary_t_data_t* a_0,
   struct _fx_N13Ast__binary_t_data_t* b_0,
   bool* fx_result,
   void* fx_fv)
{
   _fx_N13Ast__binary_t a_1 = 0;
   _fx_N13Ast__binary_t b_1 = 0;
   int fx_status = 0;
   bool result_0 = 0;
   FX_COPY_PTR(a_0, &a_1);
   FX_COPY_PTR(b_0, &b_1);
   for (;;) {
      _fx_N13Ast__binary_t a_2 = 0;
      _fx_N13Ast__binary_t b_2 = 0;
      FX_COPY_PTR(a_1, &a_2);
      FX_COPY_PTR(b_1, &b_2);
      if (FX_REC_VARIANT_TAG(b_2) == 21) {
         if (FX_REC_VARIANT_TAG(a_2) == 21) {
            result_0 = a_2->u.OpCmp.tag == b_2->u.OpCmp.tag; FX_BREAK(_fx_catch_0);  _fx_catch_0: ; goto _fx_endmatch_0;
         }
      }
      if (FX_REC_VARIANT_TAG(b_2) == 22) {
         if (FX_REC_VARIANT_TAG(a_2) == 22) {
            result_0 = a_2->u.OpDotCmp.tag == b_2->u.OpDotCmp.tag; FX_BREAK(_fx_catch_1);  _fx_catch_1: ; goto _fx_endmatch_0;
         }
      }
      if (FX_REC_VARIANT_TAG(b_2) == 27) {
         if (FX_REC_VARIANT_TAG(a_2) == 27) {
            _fx_N13Ast__binary_t* a0_0 = &a_2->u.OpAugBinary;
            _fx_free_N13Ast__binary_t(&a_1);
            FX_COPY_PTR(*a0_0, &a_1);
            _fx_N13Ast__binary_t* b0_0 = &b_2->u.OpAugBinary;
            _fx_free_N13Ast__binary_t(&b_1);
            FX_COPY_PTR(*b0_0, &b_1);
            goto _fx_endmatch_0;
         }
      }
      result_0 = FX_REC_VARIANT_TAG(a_2) == FX_REC_VARIANT_TAG(b_2);
      FX_BREAK(_fx_catch_2);

   _fx_catch_2: ;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_3);

   _fx_catch_3: ;
      if (b_2) {
         _fx_free_N13Ast__binary_t(&b_2);
      }
      if (a_2) {
         _fx_free_N13Ast__binary_t(&a_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   *fx_result = result_0;

_fx_cleanup: ;
   if (a_1) {
      _fx_free_N13Ast__binary_t(&a_1);
   }
   if (b_1) {
      _fx_free_N13Ast__binary_t(&b_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM15__eq_variants__B2N10Ast__lit_tN10Ast__lit_t(
   struct _fx_N10Ast__lit_t* a_0,
   struct _fx_N10Ast__lit_t* b_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (b_0->tag == 1) {
      if (a_0->tag == 1) {
         *fx_result = a_0->u.LitInt == b_0->u.LitInt; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 2) {
      _fx_T2il* vcase_0 = &b_0->u.LitSInt;
      if (a_0->tag == 2) {
         _fx_T2il* vcase_1 = &a_0->u.LitSInt;
         *fx_result = (bool)((vcase_1->t0 == vcase_0->t0) & (vcase_1->t1 == vcase_0->t1));
         goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 3) {
      _fx_T2iq* vcase_2 = &b_0->u.LitUInt;
      if (a_0->tag == 3) {
         _fx_T2iq* vcase_3 = &a_0->u.LitUInt;
         *fx_result = (bool)((vcase_3->t0 == vcase_2->t0) & (vcase_3->t1 == vcase_2->t1));
         goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 4) {
      _fx_T2id* vcase_4 = &b_0->u.LitFloat;
      if (a_0->tag == 4) {
         _fx_T2id* vcase_5 = &a_0->u.LitFloat;
         *fx_result = (bool)((vcase_5->t0 == vcase_4->t0) & (vcase_5->t1 == vcase_4->t1));
         goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 5) {
      if (a_0->tag == 5) {
         *fx_result = _fx_F6__eq__B2SS(&a_0->u.LitString, &b_0->u.LitString, 0); goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 6) {
      if (a_0->tag == 6) {
         *fx_result = a_0->u.LitChar == b_0->u.LitChar; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 7) {
      if (a_0->tag == 7) {
         *fx_result = a_0->u.LitBool == b_0->u.LitBool; goto _fx_endmatch_0;
      }
   }
   *fx_result = a_0->tag == b_0->tag;

_fx_endmatch_0: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM15__eq_variants__B2N14Lexer__token_tN14Lexer__token_t(
   struct _fx_N14Lexer__token_t* a_0,
   struct _fx_N14Lexer__token_t* b_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (b_0->tag == 1) {
      if (a_0->tag == 1) {
         FX_CALL(_fx_M6ParserFM15__eq_variants__B2N10Ast__lit_tN10Ast__lit_t(&a_0->u.LITERAL, &b_0->u.LITERAL, fx_result, 0),
            _fx_catch_0);

      _fx_catch_0: ;
         goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 2) {
      _fx_T2BS* vcase_0 = &b_0->u.IDENT;
      if (a_0->tag == 2) {
         _fx_T2BS* vcase_1 = &a_0->u.IDENT;
         bool v_0 = _fx_F6__eq__B2SS(&vcase_1->t1, &vcase_0->t1, 0);
         *fx_result = (bool)((vcase_1->t0 == vcase_0->t0) & v_0);
         goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 3) {
      if (a_0->tag == 3) {
         *fx_result = _fx_F6__eq__B2SS(&a_0->u.TYVAR, &b_0->u.TYVAR, 0); goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 13) {
      if (a_0->tag == 13) {
         *fx_result = _fx_F6__eq__B2SS(&a_0->u.DATA, &b_0->u.DATA, 0); goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 19) {
      if (a_0->tag == 19) {
         *fx_result = a_0->u.FOR == b_0->u.FOR; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 23) {
      if (a_0->tag == 23) {
         *fx_result = a_0->u.IMPORT == b_0->u.IMPORT; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 33) {
      if (a_0->tag == 33) {
         *fx_result = a_0->u.REF == b_0->u.REF; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 34) {
      if (a_0->tag == 34) {
         *fx_result = a_0->u.RETURN == b_0->u.RETURN; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 42) {
      if (a_0->tag == 42) {
         *fx_result = a_0->u.WHILE == b_0->u.WHILE; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 44) {
      if (a_0->tag == 44) {
         *fx_result = a_0->u.LPAREN == b_0->u.LPAREN; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 47) {
      if (a_0->tag == 47) {
         *fx_result = a_0->u.LSQUARE == b_0->u.LSQUARE; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 58) {
      if (a_0->tag == 58) {
         *fx_result = a_0->u.BACKSLASH == b_0->u.BACKSLASH; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 64) {
      if (a_0->tag == 64) {
         *fx_result = a_0->u.MINUS == b_0->u.MINUS; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 65) {
      if (a_0->tag == 65) {
         *fx_result = a_0->u.PLUS == b_0->u.PLUS; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 66) {
      if (a_0->tag == 66) {
         *fx_result = a_0->u.STAR == b_0->u.STAR; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 72) {
      if (a_0->tag == 72) {
         *fx_result = a_0->u.DOT_PLUS == b_0->u.DOT_PLUS; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 73) {
      if (a_0->tag == 73) {
         *fx_result = a_0->u.DOT_MINUS == b_0->u.DOT_MINUS; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 88) {
      if (a_0->tag == 88) {
         FX_CALL(
            _fx_M6ParserFM15__eq_variants__B2N13Ast__binary_tN13Ast__binary_t(a_0->u.AUG_BINOP, b_0->u.AUG_BINOP, fx_result, 0),
            _fx_catch_1);

      _fx_catch_1: ;
         goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 90) {
      if (a_0->tag == 90) {
         *fx_result = a_0->u.CMP.tag == b_0->u.CMP.tag; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 92) {
      if (a_0->tag == 92) {
         *fx_result = a_0->u.DOT_CMP.tag == b_0->u.DOT_CMP.tag; goto _fx_endmatch_0;
      }
   }
   if (b_0->tag == 94) {
      if (a_0->tag == 94) {
         *fx_result = _fx_F6__eq__B2SS(&a_0->u.RESERVED, &b_0->u.RESERVED, 0); goto _fx_endmatch_0;
      }
   }
   *fx_result = a_0->tag == b_0->tag;

_fx_endmatch_0: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM7printlnv1S(fx_str_t* a_0, void* fx_fv)
{
   int fx_status = 0;
   _fx_F12print_stringv1S(a_0, 0);
   fx_str_t slit_0 = FX_MAKE_STR("\n");
   _fx_F12print_stringv1S(&slit_0, 0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM8length1_i1LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t* l_0,
   int_* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   *fx_result =
      _fx_M6ParserFM6lengthi1LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(l_0, 0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM2hdN10Ast__pat_t1LN10Ast__pat_t(
   struct _fx_LN10Ast__pat_t_data_t* __pat___0,
   struct _fx_N10Ast__pat_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (__pat___0 != 0) {
      FX_COPY_PTR(__pat___0->hd, fx_result);
   }
   else {
      FX_FAST_THROW(FX_EXN_NullListError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM2hdT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* __pat___0,
   struct _fx_T2N14Lexer__token_tR10Ast__loc_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (__pat___0 != 0) {
      _fx_copy_T2N14Lexer__token_tR10Ast__loc_t(&__pat___0->hd, fx_result);
   }
   else {
      FX_FAST_THROW(FX_EXN_NullListError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM2hdN10Ast__exp_t1LN10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* __pat___0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (__pat___0 != 0) {
      FX_COPY_PTR(__pat___0->hd, fx_result);
   }
   else {
      FX_FAST_THROW(FX_EXN_NullListError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM2tlLT2N19Parser__ppifstate_tR10Ast__loc_t1LT2N19Parser__ppifstate_tR10Ast__loc_t(
   struct _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t_data_t* __pat___0,
   struct _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (__pat___0 != 0) {
      FX_COPY_PTR(__pat___0->tl, fx_result);
   }
   else {
      FX_FAST_THROW(FX_EXN_NullListError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* __pat___0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (__pat___0 != 0) {
      FX_COPY_PTR(__pat___0->tl, fx_result);
   }
   else {
      FX_FAST_THROW(FX_EXN_NullListError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM3revLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* l_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LT2N14Lexer__token_tR10Ast__loc_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t r_0 = 0;
      _fx_T2N14Lexer__token_tR10Ast__loc_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LT2N14Lexer__token_tR10Ast__loc_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM3revLT2N10Ast__pat_tN10Ast__exp_t1LT2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* l_0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LT2N10Ast__pat_tN10Ast__exp_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LT2N10Ast__pat_tN10Ast__exp_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LT2N10Ast__pat_tN10Ast__exp_t r_0 = 0;
      _fx_T2N10Ast__pat_tN10Ast__exp_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM3revLT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t1LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t* l_0,
   struct _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t r_0 = 0;
      _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(a_0, r_0, false, &r_0),
         _fx_catch_0);
      _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM3revLLN10Ast__exp_t1LLN10Ast__exp_t(
   struct _fx_LLN10Ast__exp_t_data_t* l_0,
   struct _fx_LLN10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LLN10Ast__exp_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LLN10Ast__exp_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LLN10Ast__exp_t r_0 = 0;
      _fx_LN10Ast__exp_t a_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LLN10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LLN10Ast__exp_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LLN10Ast__exp_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LLN10Ast__exp_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM3revLN10Ast__exp_t1LN10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* l_0,
   struct _fx_LN10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN10Ast__exp_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LN10Ast__exp_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN10Ast__exp_t r_0 = 0;
      _fx_N10Ast__exp_t a_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LN10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LN10Ast__exp_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LN10Ast__exp_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LN10Ast__exp_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM1tNt10Hashmap__t2SN15Parser__ppval_t6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
   struct _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* arg0,
   int_ arg1,
   int_ arg2,
   int_ arg3,
   fx_arr_t* arg4,
   fx_arr_t* arg5,
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt10Hashmap__t2SN15Parser__ppval_t);
   _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(arg0, &v->u.t.t0);
   v->u.t.t1 = arg1;
   v->u.t.t2 = arg2;
   v->u.t.t3 = arg3;
   fx_copy_arr(arg4, &v->u.t.t4);
   fx_copy_arr(arg5, &v->u.t.t5);
   return 0;
}

FX_EXTERN_C int _fx_M6ParserFM5emptyNt10Hashmap__t2SN15Parser__ppval_t3iSN15Parser__ppval_t(
   int_ size0_0,
   fx_str_t* k0_0,
   struct _fx_N15Parser__ppval_t* d0_0,
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t entry0_0 = {0};
   fx_arr_t v_0 = {0};
   fx_arr_t v_1 = {0};
   int fx_status = 0;
   int_ size_0 = 8;
   while (size_0 < size0_0) {
      size_0 = size_0 * 2;
   }
   int_ idxsize_0 = size_0 * 2;
   _fx_make_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(0ULL, k0_0, d0_0, &entry0_0);
   FX_CALL(_fx_M7HashmapFM9makeindexA1i1i(idxsize_0, &v_0, 0), _fx_cleanup);
   _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* dstptr_0 = 0;
   int_ n_0 = size_0;
   {
      const int_ shape_0[] = { n_0 };
      FX_CALL(
         fx_make_arr(1, shape_0, sizeof(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t),
            (fx_free_t)_fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t,
            (fx_copy_t)_fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, 0, &v_1), _fx_cleanup);
   }
   dstptr_0 = (_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t*)v_1.data;
   for (int_ i_0 = 0; i_0 < n_0; i_0++, dstptr_0++) {
      _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&entry0_0, dstptr_0);
   }
   FX_CALL(
      _fx_M6ParserFM1tNt10Hashmap__t2SN15Parser__ppval_t6Rt20Hashmap__hashentry_t2SN15Parser__ppval_tiiiA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
         &entry0_0, 0, 0, 0, &v_0, &v_1, fx_result), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&entry0_0);
   FX_FREE_ARR(&v_0);
   FX_FREE_ARR(&v_1);
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM9add_fast_i4iA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_tRt20Hashmap__hashentry_t2SN15Parser__ppval_t(
   int_ tabsz_0,
   fx_arr_t* ht_index_0,
   fx_arr_t* ht_table_0,
   struct _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* entry_0,
   int_* fx_result,
   void* fx_fv)
{
   fx_exn_t v_0 = {0};
   int fx_status = 0;
   int_ idxsz_0 = FX_ARR_SIZE(*ht_index_0, 0);
   uint64_t hv_0 = entry_0->hv;
   uint64_t perturb_0 = hv_0;
   int_ j_0 = (int_)hv_0 & (idxsz_0 - 1);
   bool found_free_slot_0 = false;
   int_ v_1 = idxsz_0 + 14;
   for (int_ i_0 = 0; i_0 < v_1; i_0++) {
      FX_CHKIDX(FX_CHKIDX1(*ht_index_0, 0, j_0), _fx_catch_0);
      int_ tidx_0 = *FX_PTR_1D(int_, *ht_index_0, j_0);
      if (tidx_0 == 0) {
         FX_CHKIDX(FX_CHKIDX1(*ht_index_0, 0, j_0), _fx_catch_0);
         *FX_PTR_1D(int_, *ht_index_0, j_0) = tabsz_0 + 2;
         FX_CHKIDX(FX_CHKIDX1(*ht_table_0, 0, tabsz_0), _fx_catch_0);
         _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* v_2 =
            FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, *ht_table_0, tabsz_0);
         _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(v_2);
         _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(entry_0, v_2);
         found_free_slot_0 = true;
         FX_BREAK(_fx_catch_0);
      }
      perturb_0 = perturb_0 >> 5;
      j_0 = (int_)((uint64_t)(j_0 * 5 + 1) + perturb_0) & (idxsz_0 - 1);

   _fx_catch_0: ;
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   if (!found_free_slot_0) {
      fx_str_t slit_0 = FX_MAKE_STR("cannot insert element (full Hashtable?!)");
      FX_CALL(_fx_F9make_FailE1S(&slit_0, &v_0), _fx_cleanup);
      FX_THROW(&v_0, true, _fx_cleanup);
   }
   *fx_result = tabsz_0 + 1;

_fx_cleanup: ;
   fx_free_exn(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM4growv2Nt10Hashmap__t2SN15Parser__ppval_ti(
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t* self_0,
   int_ new_size_0,
   void* fx_fv)
{
   fx_arr_t ht_table_0 = {0};
   _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t v_0 = {0};
   fx_arr_t new_ht_table_0 = {0};
   fx_arr_t new_ht_index_0 = {0};
   int fx_status = 0;
   fx_copy_arr(&self_0->u.t.t5, &ht_table_0);
   _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&self_0->u.t.t0, &v_0);
   _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* dstptr_0 = 0;
   {
      const int_ shape_0[] = { new_size_0 };
      FX_CALL(
         fx_make_arr(1, shape_0, sizeof(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t),
            (fx_free_t)_fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t,
            (fx_copy_t)_fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, 0, &new_ht_table_0), _fx_cleanup);
   }
   dstptr_0 = (_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t*)new_ht_table_0.data;
   for (int_ i_0 = 0; i_0 < new_size_0; i_0++, dstptr_0++) {
      _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&v_0, dstptr_0);
   }
   FX_CALL(_fx_M7HashmapFM9makeindexA1i1i(new_size_0 * 2, &new_ht_index_0, 0), _fx_cleanup);
   int_ tabsz_0 = 0;
   int_ v_1 = self_0->u.t.t2;
   for (int_ j_0 = 0; j_0 < v_1; j_0++) {
      _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t v_2 = {0};
      FX_CHKIDX(FX_CHKIDX1(ht_table_0, 0, j_0), _fx_catch_0);
      if (FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, ht_table_0, j_0)->hv < 9223372036854775808ULL) {
         FX_CHKIDX(FX_CHKIDX1(ht_table_0, 0, j_0), _fx_catch_0);
         _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
            FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, ht_table_0, j_0), &v_2);
         int_ v_3;
         FX_CALL(
            _fx_M6ParserFM9add_fast_i4iA1iA1Rt20Hashmap__hashentry_t2SN15Parser__ppval_tRt20Hashmap__hashentry_t2SN15Parser__ppval_t(
               tabsz_0, &new_ht_index_0, &new_ht_table_0, &v_2, &v_3, 0), _fx_catch_0);
         tabsz_0 = v_3;
      }

   _fx_catch_0: ;
      _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&v_2);
      FX_CHECK_EXN(_fx_cleanup);
   }
   fx_arr_t* v_4 = &self_0->u.t.t4;
   FX_FREE_ARR(v_4);
   fx_copy_arr(&new_ht_index_0, v_4);
   fx_arr_t* v_5 = &self_0->u.t.t5;
   FX_FREE_ARR(v_5);
   fx_copy_arr(&new_ht_table_0, v_5);
   self_0->u.t.t2 = tabsz_0;
   self_0->u.t.t3 = 0;

_fx_cleanup: ;
   FX_FREE_ARR(&ht_table_0);
   _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&v_0);
   FX_FREE_ARR(&new_ht_table_0);
   FX_FREE_ARR(&new_ht_index_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM9find_idx_Ta2i2Nt10Hashmap__t2SN15Parser__ppval_tS(
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t* self_0,
   fx_str_t* k_0,
   struct _fx_Ta2i* fx_result,
   void* fx_fv)
{
   fx_arr_t v_0 = {0};
   int fx_status = 0;
   uint64_t v_1 = _fx_F4hashq1S(k_0, 0);
   uint64_t hv_0 = v_1 & 9223372036854775807ULL;
   fx_copy_arr(&self_0->u.t.t4, &v_0);
   int_ idxsz_0 = FX_ARR_SIZE(v_0, 0);
   uint64_t perturb_0 = hv_0;
   int_ found_0 = -1;
   int_ j_0 = (int_)hv_0 & (idxsz_0 - 1);
   int_ v_2 = idxsz_0 + 14;
   for (int_ i_0 = 0; i_0 < v_2; i_0++) {
      _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t entry_0 = {0};
      fx_str_t v_3 = {0};
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_catch_0);
      int_ tidx_0 = *FX_PTR_1D(int_, self_0->u.t.t4, j_0);
      if (tidx_0 >= 2) {
         int_ v_4 = tidx_0 - 2;
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, v_4), _fx_catch_0);
         _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
            FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, self_0->u.t.t5, v_4), &entry_0);
         bool v_5;
         if (entry_0.hv == hv_0) {
            fx_copy_str(&entry_0.key, &v_3); v_5 = _fx_F6__eq__B2SS(&v_3, k_0, 0);
         }
         else {
            v_5 = false;
         }
         if (v_5) {
            found_0 = tidx_0 - 2; FX_BREAK(_fx_catch_0);
         }
      }
      else if (tidx_0 == 0) {
         FX_BREAK(_fx_catch_0);
      }
      perturb_0 = perturb_0 >> 5;
      j_0 = (int_)((uint64_t)(j_0 * 5 + 1) + perturb_0) & (idxsz_0 - 1);

   _fx_catch_0: ;
      FX_FREE_STR(&v_3);
      _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&entry_0);
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_Ta2i tup_0 = { j_0, found_0 };
   *fx_result = tup_0;

_fx_cleanup: ;
   FX_FREE_ARR(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM3memB2Nt10Hashmap__t2SN15Parser__ppval_tS(
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t* self_0,
   fx_str_t* k_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_Ta2i v_0;
   FX_CALL(_fx_M6ParserFM9find_idx_Ta2i2Nt10Hashmap__t2SN15Parser__ppval_tS(self_0, k_0, &v_0, 0), _fx_cleanup);
   *fx_result = v_0.t1 >= 0;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM18find_idx_or_inserti2Nt10Hashmap__t2SN15Parser__ppval_tS(
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t* self_0,
   fx_str_t* k_0,
   int_* fx_result,
   void* fx_fv)
{
   fx_arr_t v_0 = {0};
   fx_arr_t v_1 = {0};
   _fx_N15Parser__ppval_t v_2 = {0};
   _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t v_3 = {0};
   fx_exn_t v_4 = {0};
   int fx_status = 0;
   uint64_t v_5 = _fx_F4hashq1S(k_0, 0);
   uint64_t hv_0 = v_5 & 9223372036854775807ULL;
   fx_copy_arr(&self_0->u.t.t4, &v_0);
   int_ idxsz_0 = FX_ARR_SIZE(v_0, 0);
   if (self_0->u.t.t1 + 1 > idxsz_0 >> 1) {
      while (idxsz_0 < (self_0->u.t.t1 + 1) * 2) {
         idxsz_0 = idxsz_0 * 2;
      }
      FX_CALL(_fx_M6ParserFM4growv2Nt10Hashmap__t2SN15Parser__ppval_ti(self_0, fx_maxi(idxsz_0 / 2, self_0->u.t.t1 + 1), 0),
         _fx_cleanup);
   }
   uint64_t perturb_0 = hv_0;
   int_ found_0 = -1;
   int_ insert_idx_0 = -1;
   int_ j_0 = (int_)hv_0 & (idxsz_0 - 1);
   int_ v_6 = idxsz_0 + 14;
   for (int_ i_0 = 0; i_0 < v_6; i_0++) {
      _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t entry_0 = {0};
      fx_str_t v_7 = {0};
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_catch_0);
      int_ tidx_0 = *FX_PTR_1D(int_, self_0->u.t.t4, j_0);
      if (tidx_0 >= 2) {
         int_ v_8 = tidx_0 - 2;
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, v_8), _fx_catch_0);
         _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(
            FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, self_0->u.t.t5, v_8), &entry_0);
         bool v_9;
         if (entry_0.hv == hv_0) {
            fx_copy_str(&entry_0.key, &v_7); v_9 = _fx_F6__eq__B2SS(&v_7, k_0, 0);
         }
         else {
            v_9 = false;
         }
         if (v_9) {
            found_0 = tidx_0 - 2; FX_BREAK(_fx_catch_0);
         }
      }
      else if (tidx_0 == 0) {
         if (insert_idx_0 < 0) {
            insert_idx_0 = j_0;
         }
         FX_BREAK(_fx_catch_0);
      }
      else {
         bool t_0;
         if (tidx_0 == 1) {
            t_0 = insert_idx_0 < 0;
         }
         else {
            t_0 = false;
         }
         if (t_0) {
            insert_idx_0 = j_0;
         }
      }
      perturb_0 = perturb_0 >> 5;
      j_0 = (int_)((uint64_t)(j_0 * 5 + 1) + perturb_0) & (idxsz_0 - 1);

   _fx_catch_0: ;
      FX_FREE_STR(&v_7);
      _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&entry_0);
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   if (found_0 >= 0) {
      bool t_1;
      if (insert_idx_0 >= 0) {
         t_1 = insert_idx_0 != j_0;
      }
      else {
         t_1 = false;
      }
      if (t_1) {
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, insert_idx_0), _fx_cleanup);
         *FX_PTR_1D(int_, self_0->u.t.t4, insert_idx_0) = found_0 + 2;
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_cleanup);
         *FX_PTR_1D(int_, self_0->u.t.t4, j_0) = 1;
      }
   }
   else if (insert_idx_0 >= 0) {
      found_0 = self_0->u.t.t3 - 1;
      if (found_0 >= 0) {
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, found_0), _fx_cleanup);
         self_0->u.t.t3 =
            (int_)
               (FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, self_0->u.t.t5, found_0)->hv &
                  9223372036854775807ULL);
      }
      else {
         found_0 = self_0->u.t.t2;
         self_0->u.t.t2 = self_0->u.t.t2 + 1;
         fx_copy_arr(&self_0->u.t.t5, &v_1);
         FX_CALL(_fx_F6assertv1B(found_0 < FX_ARR_SIZE(v_1, 0), 0), _fx_cleanup);
      }
      _fx_copy_N15Parser__ppval_t(&self_0->u.t.t0.data, &v_2);
      _fx_make_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(hv_0, k_0, &v_2, &v_3);
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, found_0), _fx_cleanup);
      _fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t* v_10 =
         FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, self_0->u.t.t5, found_0);
      _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(v_10);
      _fx_copy_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&v_3, v_10);
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, insert_idx_0), _fx_cleanup);
      *FX_PTR_1D(int_, self_0->u.t.t4, insert_idx_0) = found_0 + 2;
      self_0->u.t.t1 = self_0->u.t.t1 + 1;
   }
   else {
      fx_str_t slit_0 = FX_MAKE_STR("cannot insert element (full Hashtable?!)");
      FX_CALL(_fx_F9make_FailE1S(&slit_0, &v_4), _fx_cleanup);
      FX_THROW(&v_4, true, _fx_cleanup);
   }
   *fx_result = found_0;

_fx_cleanup: ;
   FX_FREE_ARR(&v_0);
   FX_FREE_ARR(&v_1);
   _fx_free_N15Parser__ppval_t(&v_2);
   _fx_free_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t(&v_3);
   fx_free_exn(&v_4);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM3addv3Nt10Hashmap__t2SN15Parser__ppval_tSN15Parser__ppval_t(
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t* self_0,
   fx_str_t* k_0,
   struct _fx_N15Parser__ppval_t* d_0,
   void* fx_fv)
{
   int fx_status = 0;
   int_ idx_0;
   FX_CALL(_fx_M6ParserFM18find_idx_or_inserti2Nt10Hashmap__t2SN15Parser__ppval_tS(self_0, k_0, &idx_0, 0), _fx_cleanup);
   FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, idx_0), _fx_cleanup);
   _fx_N15Parser__ppval_t* v_0 = &FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, self_0->u.t.t5, idx_0)->data;
   _fx_free_N15Parser__ppval_t(v_0);
   _fx_copy_N15Parser__ppval_t(d_0, v_0);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM6removev2Nt10Hashmap__t2SN15Parser__ppval_tS(
   struct _fx_Nt10Hashmap__t2SN15Parser__ppval_t_data_t* self_0,
   fx_str_t* k_0,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_Ta2i v_0;
   FX_CALL(_fx_M6ParserFM9find_idx_Ta2i2Nt10Hashmap__t2SN15Parser__ppval_tS(self_0, k_0, &v_0, 0), _fx_cleanup);
   int_ j_0 = v_0.t0;
   int_ tidx_0 = v_0.t1;
   if (tidx_0 >= 0) {
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_cleanup);
      *FX_PTR_1D(int_, self_0->u.t.t4, j_0) = 1;
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, tidx_0), _fx_cleanup);
      FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, self_0->u.t.t5, tidx_0)->hv =
         (uint64_t)self_0->u.t.t3 | 9223372036854775808ULL;
      self_0->u.t.t3 = tidx_0 + 1;
      self_0->u.t.t1 = self_0->u.t.t1 - 1;
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM9add_fast_i4iA1iA1Rt24Hashset__hashset_entry_t1SRt24Hashset__hashset_entry_t1S(
   int_ tabsz_0,
   fx_arr_t* ht_index_0,
   fx_arr_t* ht_table_0,
   struct _fx_Rt24Hashset__hashset_entry_t1S* entry_0,
   int_* fx_result,
   void* fx_fv)
{
   fx_exn_t v_0 = {0};
   int fx_status = 0;
   int_ idxsz_0 = FX_ARR_SIZE(*ht_index_0, 0);
   uint64_t hv_0 = entry_0->hv;
   uint64_t perturb_0 = hv_0;
   int_ j_0 = (int_)hv_0 & (idxsz_0 - 1);
   bool found_free_slot_0 = false;
   int_ v_1 = idxsz_0 + 14;
   for (int_ i_0 = 0; i_0 < v_1; i_0++) {
      FX_CHKIDX(FX_CHKIDX1(*ht_index_0, 0, j_0), _fx_catch_0);
      int_ tidx_0 = *FX_PTR_1D(int_, *ht_index_0, j_0);
      if (tidx_0 == 0) {
         FX_CHKIDX(FX_CHKIDX1(*ht_index_0, 0, j_0), _fx_catch_0);
         *FX_PTR_1D(int_, *ht_index_0, j_0) = tabsz_0 + 2;
         FX_CHKIDX(FX_CHKIDX1(*ht_table_0, 0, tabsz_0), _fx_catch_0);
         _fx_Rt24Hashset__hashset_entry_t1S* v_2 = FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1S, *ht_table_0, tabsz_0);
         _fx_free_Rt24Hashset__hashset_entry_t1S(v_2);
         _fx_copy_Rt24Hashset__hashset_entry_t1S(entry_0, v_2);
         found_free_slot_0 = true;
         FX_BREAK(_fx_catch_0);
      }
      perturb_0 = perturb_0 >> 5;
      j_0 = (int_)((uint64_t)(j_0 * 5 + 1) + perturb_0) & (idxsz_0 - 1);

   _fx_catch_0: ;
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   if (!found_free_slot_0) {
      fx_str_t slit_0 = FX_MAKE_STR("cannot insert element (full Hashtable?!)");
      FX_CALL(_fx_F9make_FailE1S(&slit_0, &v_0), _fx_cleanup);
      FX_THROW(&v_0, true, _fx_cleanup);
   }
   *fx_result = tabsz_0 + 1;

_fx_cleanup: ;
   fx_free_exn(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM4growv2Nt10Hashset__t1Si(struct _fx_Nt10Hashset__t1S_data_t* self_0, int_ new_size_0, void* fx_fv)
{
   fx_arr_t ht_table_0 = {0};
   _fx_Rt24Hashset__hashset_entry_t1S v_0 = {0};
   fx_arr_t new_ht_table_0 = {0};
   fx_arr_t new_ht_index_0 = {0};
   int fx_status = 0;
   fx_copy_arr(&self_0->u.t.t5, &ht_table_0);
   _fx_copy_Rt24Hashset__hashset_entry_t1S(&self_0->u.t.t0, &v_0);
   _fx_Rt24Hashset__hashset_entry_t1S* dstptr_0 = 0;
   {
      const int_ shape_0[] = { new_size_0 };
      FX_CALL(
         fx_make_arr(1, shape_0, sizeof(_fx_Rt24Hashset__hashset_entry_t1S), (fx_free_t)_fx_free_Rt24Hashset__hashset_entry_t1S,
            (fx_copy_t)_fx_copy_Rt24Hashset__hashset_entry_t1S, 0, &new_ht_table_0), _fx_cleanup);
   }
   dstptr_0 = (_fx_Rt24Hashset__hashset_entry_t1S*)new_ht_table_0.data;
   for (int_ i_0 = 0; i_0 < new_size_0; i_0++, dstptr_0++) {
      _fx_copy_Rt24Hashset__hashset_entry_t1S(&v_0, dstptr_0);
   }
   FX_CALL(_fx_M7HashsetFM9makeindexA1i1i(new_size_0 * 2, &new_ht_index_0, 0), _fx_cleanup);
   int_ tabsz_0 = 0;
   int_ v_1 = self_0->u.t.t2;
   for (int_ j_0 = 0; j_0 < v_1; j_0++) {
      _fx_Rt24Hashset__hashset_entry_t1S v_2 = {0};
      FX_CHKIDX(FX_CHKIDX1(ht_table_0, 0, j_0), _fx_catch_0);
      if (FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1S, ht_table_0, j_0)->hv < 9223372036854775808ULL) {
         FX_CHKIDX(FX_CHKIDX1(ht_table_0, 0, j_0), _fx_catch_0);
         _fx_copy_Rt24Hashset__hashset_entry_t1S(FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1S, ht_table_0, j_0), &v_2);
         int_ v_3;
         FX_CALL(
            _fx_M6ParserFM9add_fast_i4iA1iA1Rt24Hashset__hashset_entry_t1SRt24Hashset__hashset_entry_t1S(tabsz_0,
               &new_ht_index_0, &new_ht_table_0, &v_2, &v_3, 0), _fx_catch_0);
         tabsz_0 = v_3;
      }

   _fx_catch_0: ;
      _fx_free_Rt24Hashset__hashset_entry_t1S(&v_2);
      FX_CHECK_EXN(_fx_cleanup);
   }
   fx_arr_t* v_4 = &self_0->u.t.t4;
   FX_FREE_ARR(v_4);
   fx_copy_arr(&new_ht_index_0, v_4);
   fx_arr_t* v_5 = &self_0->u.t.t5;
   FX_FREE_ARR(v_5);
   fx_copy_arr(&new_ht_table_0, v_5);
   self_0->u.t.t2 = tabsz_0;
   self_0->u.t.t3 = 0;

_fx_cleanup: ;
   FX_FREE_ARR(&ht_table_0);
   _fx_free_Rt24Hashset__hashset_entry_t1S(&v_0);
   FX_FREE_ARR(&new_ht_table_0);
   FX_FREE_ARR(&new_ht_index_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM9find_idx_Ta2i3Nt10Hashset__t1SSq(
   struct _fx_Nt10Hashset__t1S_data_t* self_0,
   fx_str_t* k_0,
   uint64_t hv_0,
   struct _fx_Ta2i* fx_result,
   void* fx_fv)
{
   fx_arr_t v_0 = {0};
   int fx_status = 0;
   fx_copy_arr(&self_0->u.t.t4, &v_0);
   int_ idxsz_0 = FX_ARR_SIZE(v_0, 0);
   uint64_t perturb_0 = hv_0;
   int_ found_0 = -1;
   int_ j_0 = (int_)hv_0 & (idxsz_0 - 1);
   int_ v_1 = idxsz_0 + 14;
   for (int_ i_0 = 0; i_0 < v_1; i_0++) {
      _fx_Rt24Hashset__hashset_entry_t1S entry_0 = {0};
      fx_str_t v_2 = {0};
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_catch_0);
      int_ tidx_0 = *FX_PTR_1D(int_, self_0->u.t.t4, j_0);
      if (tidx_0 >= 2) {
         int_ v_3 = tidx_0 - 2;
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, v_3), _fx_catch_0);
         _fx_copy_Rt24Hashset__hashset_entry_t1S(FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1S, self_0->u.t.t5, v_3), &entry_0);
         bool v_4;
         if (entry_0.hv == hv_0) {
            fx_copy_str(&entry_0.key, &v_2); v_4 = _fx_F6__eq__B2SS(&v_2, k_0, 0);
         }
         else {
            v_4 = false;
         }
         if (v_4) {
            found_0 = tidx_0 - 2; FX_BREAK(_fx_catch_0);
         }
      }
      else if (tidx_0 == 0) {
         FX_BREAK(_fx_catch_0);
      }
      perturb_0 = perturb_0 >> 5;
      j_0 = (int_)((uint64_t)(j_0 * 5 + 1) + perturb_0) & (idxsz_0 - 1);

   _fx_catch_0: ;
      FX_FREE_STR(&v_2);
      _fx_free_Rt24Hashset__hashset_entry_t1S(&entry_0);
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_Ta2i tup_0 = { j_0, found_0 };
   *fx_result = tup_0;

_fx_cleanup: ;
   FX_FREE_ARR(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM4add_v3Nt10Hashset__t1SSq(
   struct _fx_Nt10Hashset__t1S_data_t* self_0,
   fx_str_t* k_0,
   uint64_t hv_0,
   void* fx_fv)
{
   fx_arr_t v_0 = {0};
   fx_arr_t v_1 = {0};
   _fx_Rt24Hashset__hashset_entry_t1S v_2 = {0};
   fx_exn_t v_3 = {0};
   int fx_status = 0;
   fx_copy_arr(&self_0->u.t.t4, &v_0);
   int_ idxsz_0 = FX_ARR_SIZE(v_0, 0);
   if (self_0->u.t.t1 + 1 > idxsz_0 >> 1) {
      while (idxsz_0 < (self_0->u.t.t1 + 1) * 2) {
         idxsz_0 = idxsz_0 * 2;
      }
      FX_CALL(_fx_M6ParserFM4growv2Nt10Hashset__t1Si(self_0, fx_maxi(idxsz_0 / 2, self_0->u.t.t1 + 1), 0), _fx_cleanup);
   }
   uint64_t perturb_0 = hv_0;
   int_ found_0 = -1;
   int_ insert_idx_0 = -1;
   int_ j_0 = (int_)hv_0 & (idxsz_0 - 1);
   int_ v_4 = idxsz_0 + 14;
   for (int_ i_0 = 0; i_0 < v_4; i_0++) {
      _fx_Rt24Hashset__hashset_entry_t1S entry_0 = {0};
      fx_str_t v_5 = {0};
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_catch_0);
      int_ tidx_0 = *FX_PTR_1D(int_, self_0->u.t.t4, j_0);
      if (tidx_0 >= 2) {
         int_ v_6 = tidx_0 - 2;
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, v_6), _fx_catch_0);
         _fx_copy_Rt24Hashset__hashset_entry_t1S(FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1S, self_0->u.t.t5, v_6), &entry_0);
         bool v_7;
         if (entry_0.hv == hv_0) {
            fx_copy_str(&entry_0.key, &v_5); v_7 = _fx_F6__eq__B2SS(&v_5, k_0, 0);
         }
         else {
            v_7 = false;
         }
         if (v_7) {
            found_0 = tidx_0 - 2; FX_BREAK(_fx_catch_0);
         }
      }
      else if (tidx_0 == 0) {
         if (insert_idx_0 < 0) {
            insert_idx_0 = j_0;
         }
         FX_BREAK(_fx_catch_0);
      }
      else {
         bool t_0;
         if (tidx_0 == 1) {
            t_0 = insert_idx_0 < 0;
         }
         else {
            t_0 = false;
         }
         if (t_0) {
            insert_idx_0 = j_0;
         }
      }
      perturb_0 = perturb_0 >> 5;
      j_0 = (int_)((uint64_t)(j_0 * 5 + 1) + perturb_0) & (idxsz_0 - 1);

   _fx_catch_0: ;
      FX_FREE_STR(&v_5);
      _fx_free_Rt24Hashset__hashset_entry_t1S(&entry_0);
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   if (found_0 >= 0) {
      bool t_1;
      if (insert_idx_0 >= 0) {
         t_1 = insert_idx_0 != j_0;
      }
      else {
         t_1 = false;
      }
      if (t_1) {
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, insert_idx_0), _fx_cleanup);
         *FX_PTR_1D(int_, self_0->u.t.t4, insert_idx_0) = found_0 + 2;
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_cleanup);
         *FX_PTR_1D(int_, self_0->u.t.t4, j_0) = 1;
      }
   }
   else if (insert_idx_0 >= 0) {
      found_0 = self_0->u.t.t3 - 1;
      if (found_0 >= 0) {
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, found_0), _fx_cleanup);
         self_0->u.t.t3 =
            (int_)(FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1S, self_0->u.t.t5, found_0)->hv & 9223372036854775807ULL);
      }
      else {
         found_0 = self_0->u.t.t2;
         self_0->u.t.t2 = self_0->u.t.t2 + 1;
         fx_copy_arr(&self_0->u.t.t5, &v_1);
         FX_CALL(_fx_F6assertv1B(found_0 < FX_ARR_SIZE(v_1, 0), 0), _fx_cleanup);
      }
      _fx_make_Rt24Hashset__hashset_entry_t1S(hv_0, k_0, &v_2);
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, found_0), _fx_cleanup);
      _fx_Rt24Hashset__hashset_entry_t1S* v_8 = FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1S, self_0->u.t.t5, found_0);
      _fx_free_Rt24Hashset__hashset_entry_t1S(v_8);
      _fx_copy_Rt24Hashset__hashset_entry_t1S(&v_2, v_8);
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, insert_idx_0), _fx_cleanup);
      *FX_PTR_1D(int_, self_0->u.t.t4, insert_idx_0) = found_0 + 2;
      self_0->u.t.t1 = self_0->u.t.t1 + 1;
   }
   else {
      fx_str_t slit_0 = FX_MAKE_STR("cannot insert element (full Hashtable?!)");
      FX_CALL(_fx_F9make_FailE1S(&slit_0, &v_3), _fx_cleanup);
      FX_THROW(&v_3, true, _fx_cleanup);
   }

_fx_cleanup: ;
   FX_FREE_ARR(&v_0);
   FX_FREE_ARR(&v_1);
   _fx_free_Rt24Hashset__hashset_entry_t1S(&v_2);
   fx_free_exn(&v_3);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(
   struct _fx_R10Ast__loc_t* arg0,
   fx_str_t* arg1,
   fx_exn_t* fx_result)
{
   FX_MAKE_EXN_IMPL_START(_FX_EXN_E18Parser__ParseError, _fx_E18Parser__ParseError_data_t, _fx_E18Parser__ParseError_info);
   exn_data->data.t0 = *arg0;
   fx_copy_str(arg1, &exn_data->data.t1);
   return 0;
}

FX_EXTERN_C void _fx_M6ParserFM11PP_BR_FALSEN19Parser__ppifstate_t1B(bool arg0, struct _fx_N19Parser__ppifstate_t* fx_result)
{
   fx_result->tag = 2;
   fx_result->u.PP_BR_FALSE = arg0;
}

FX_EXTERN_C void _fx_M6ParserFM10PP_BR_ELSEN19Parser__ppifstate_t1B(bool arg0, struct _fx_N19Parser__ppifstate_t* fx_result)
{
   fx_result->tag = 3;
   fx_result->u.PP_BR_ELSE = arg0;
}

FX_EXTERN_C void _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(int64_t arg0, struct _fx_N15Parser__ppval_t* fx_result)
{
   fx_result->tag = 1;
   fx_result->u.PP_INT = arg0;
}

FX_EXTERN_C void _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B(bool arg0, struct _fx_N15Parser__ppval_t* fx_result)
{
   fx_result->tag = 2;
   fx_result->u.PP_BOOL = arg0;
}

FX_EXTERN_C void _fx_M6ParserFM9PP_STRINGN15Parser__ppval_t1S(fx_str_t* arg0, struct _fx_N15Parser__ppval_t* fx_result)
{
   fx_result->tag = 3;
   fx_copy_str(arg0, &fx_result->u.PP_STRING);
}

FX_EXTERN_C int _fx_M6ParserFM23add_to_imported_modulesi2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* mname_0,
   struct _fx_R10Ast__loc_t* loc_0,
   int_* fx_result,
   void* fx_fv)
{
   fx_str_t mfname_0 = {0};
   _fx_LS v_0 = 0;
   fx_str_t v_1 = {0};
   fx_str_t mfname_1 = {0};
   fx_str_t mfname_2 = {0};
   fx_exn_t exn_0 = {0};
   fx_str_t dirname_0 = {0};
   _fx_Li v_2 = 0;
   _fx_Li v_3 = 0;
   int fx_status = 0;
   FX_CALL(_fx_M3AstFM2ppS1RM4id_t(mname_0, &mfname_0, 0), _fx_cleanup);
   FX_CALL(_fx_M6StringFM5splitLS3SCB(&mfname_0, (char_)46, false, &v_0, 0), _fx_cleanup);
   int_ ncomps_0 = _fx_M6ParserFM6lengthi1LS(v_0, 0);
   FX_CALL(_fx_M8FilenameFM7dir_sepS0(&v_1, 0), _fx_cleanup);
   fx_str_t slit_0 = FX_MAKE_STR(".");
   FX_CALL(_fx_M6StringFM7replaceS3SSS(&mfname_0, &slit_0, &v_1, &mfname_1, 0), _fx_cleanup);
   fx_str_t v_4 = {0};
   _fx_LS v_5 = 0;
   fx_str_t slit_1 = FX_MAKE_STR(".fx");
   {
      const fx_str_t strs_0[] = { mfname_1, slit_1 };
      FX_CALL(fx_strjoin(0, 0, 0, strs_0, 2, &v_4), _fx_catch_0);
   }
   FX_COPY_PTR(_fx_g18Parser__parser_ctx.inc_dirs, &v_5);
   FX_CALL(_fx_M8FilenameFM6locateS2SLS(&v_4, v_5, &mfname_2, 0), _fx_catch_0);

_fx_catch_0: ;
   FX_FREE_STR(&v_4);
   if (v_5) {
      _fx_free_LS(&v_5);
   }
   if (fx_status < 0) {
      fx_exn_get_and_reset(fx_status, &exn_0);
      fx_status = 0;
      FX_FREE_STR(&mfname_2);
      if (exn_0.tag == FX_EXN_NotFoundError) {
         fx_exn_t exn_1 = {0};
         fx_str_t v_6 = {0};
         _fx_LS v_7 = 0;
         ncomps_0 = ncomps_0 + 1;
         fx_str_t slit_2 = FX_MAKE_STR("init.fx");
         FX_CALL(_fx_M8FilenameFM6concatS2SS(&mfname_1, &slit_2, &v_6, 0), _fx_catch_1);
         FX_COPY_PTR(_fx_g18Parser__parser_ctx.inc_dirs, &v_7);
         FX_CALL(_fx_M8FilenameFM6locateS2SLS(&v_6, v_7, &mfname_2, 0), _fx_catch_1);

      _fx_catch_1: ;
         FX_FREE_STR(&v_6);
         if (v_7) {
            _fx_free_LS(&v_7);
         }
         if (fx_status < 0) {
            fx_exn_get_and_reset(fx_status, &exn_1);
            fx_status = 0;
            FX_FREE_STR(&mfname_2);
            if (exn_1.tag == FX_EXN_NotFoundError) {
               fx_str_t v_8 = {0};
               fx_str_t v_9 = {0};
               fx_exn_t v_10 = {0};
               FX_CALL(_fx_M3AstFM6stringS1RM4id_t(mname_0, &v_8, 0), _fx_catch_2);
               fx_str_t slit_3 = FX_MAKE_STR("module ");
               fx_str_t slit_4 = FX_MAKE_STR(" is not found");
               {
                  const fx_str_t strs_1[] = { slit_3, v_8, slit_4 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_9), _fx_catch_2);
               }
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(loc_0, &v_9, &v_10), _fx_catch_2);
               FX_THROW(&v_10, true, _fx_catch_2);

            _fx_catch_2: ;
               fx_free_exn(&v_10);
               FX_FREE_STR(&v_9);
               FX_FREE_STR(&v_8);
            }
            else {
               FX_RETHROW(&exn_1, _fx_catch_3);
            }
            FX_CHECK_EXN(_fx_catch_3);
         }

      _fx_catch_3: ;
         fx_free_exn(&exn_1);
      }
      else {
         FX_RETHROW(&exn_0, _fx_cleanup);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   fx_copy_str(&mfname_2, &dirname_0);
   int_ n_0 = ncomps_0;
   for (int_ i_0 = 0; i_0 < n_0; i_0++) {
      fx_str_t v_11 = {0};
      FX_CALL(_fx_M8FilenameFM7dirnameS1S(&dirname_0, &v_11, 0), _fx_catch_4);
      FX_FREE_STR(&dirname_0);
      fx_copy_str(&v_11, &dirname_0);
      uint64_t v_12 = _fx_F4hashq1S(&dirname_0, 0);
      _fx_Ta2i v_13;
      FX_CALL(
         _fx_M6ParserFM9find_idx_Ta2i3Nt10Hashset__t1SSq(_fx_g19Ast__all_c_inc_dirs, &dirname_0, v_12 & 9223372036854775807ULL,
            &v_13, 0), _fx_catch_4);
      if (v_13.t1 >= 0) {
         FX_BREAK(_fx_catch_4);
      }
      uint64_t v_14 = _fx_F4hashq1S(&dirname_0, 0);
      FX_CALL(_fx_M6ParserFM4add_v3Nt10Hashset__t1SSq(_fx_g19Ast__all_c_inc_dirs, &dirname_0, v_14 & 9223372036854775807ULL, 0),
         _fx_catch_4);

   _fx_catch_4: ;
      FX_FREE_STR(&v_11);
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   int_ m_idx_0;
   FX_CALL(_fx_M3AstFM11find_modulei2RM4id_tS(mname_0, &mfname_2, &m_idx_0, 0), _fx_cleanup);
   FX_COPY_PTR(_fx_g18Parser__parser_ctx.deps, &v_2);
   bool __fold_result___0 = false;
   _fx_Li lst_0 = v_2;
   for (; lst_0; lst_0 = lst_0->tl) {
      int_ b_0 = lst_0->hd;
      if (m_idx_0 == b_0) {
         __fold_result___0 = true; FX_BREAK(_fx_catch_5);
      }

   _fx_catch_5: ;
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   if (!__fold_result___0) {
      FX_COPY_PTR(_fx_g18Parser__parser_ctx.deps, &v_3);
      FX_CALL(_fx_cons_Li(m_idx_0, v_3, false, &v_3), _fx_cleanup);
      _fx_Li* v_15 = &_fx_g18Parser__parser_ctx.deps;
      FX_FREE_LIST_SIMPLE(v_15);
      FX_COPY_PTR(v_3, v_15);
   }
   *fx_result = m_idx_0;

_fx_cleanup: ;
   FX_FREE_STR(&mfname_0);
   if (v_0) {
      _fx_free_LS(&v_0);
   }
   FX_FREE_STR(&v_1);
   FX_FREE_STR(&mfname_1);
   FX_FREE_STR(&mfname_2);
   fx_free_exn(&exn_0);
   FX_FREE_STR(&dirname_0);
   FX_FREE_LIST_SIMPLE(&v_2);
   FX_FREE_LIST_SIMPLE(&v_3);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM17good_variant_nameB1S(fx_str_t* s_0, bool* fx_result, void* fx_fv)
{
   int fx_status = 0;
   FX_STR_CHKIDX(*s_0, 0, _fx_cleanup);
   char_ c_0 = FX_STR_ELEM(*s_0, 0);
   if ((bool)(((char_)65 <= c_0) & (c_0 <= (char_)90))) {
      *fx_result = true;
   }
   else {
      *fx_result = _fx_M6StringFM8containsB2SC(s_0, (char_)46, 0);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10make_unaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_N12Ast__unary_t* uop_0,
   struct _fx_N10Ast__exp_t_data_t* e_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_0 = {0};
   int fx_status = 0;
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(loc_0, &v_0, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(uop_0, e_0, &v_0, fx_result),
      _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM12make_literalN10Ast__exp_t2N10Ast__lit_tR10Ast__loc_t(
   struct _fx_N10Ast__lit_t* lit_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N10Ast__typ_t v_0 = 0;
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_1 = {0};
   int fx_status = 0;
   FX_CALL(_fx_M3AstFM11get_lit_typN10Ast__typ_t1N10Ast__lit_t(lit_0, &v_0, 0), _fx_cleanup);
   _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_0, loc_0, &v_1);
   FX_CALL(_fx_M3AstFM6ExpLitN10Ast__exp_t2N10Ast__lit_tT2N10Ast__typ_tRM5loc_t(lit_0, &v_1, fx_result), _fx_cleanup);

_fx_cleanup: ;
   if (v_0) {
      _fx_free_N10Ast__typ_t(&v_0);
   }
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_1);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10make_identN10Ast__exp_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* i_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_0 = {0};
   int fx_status = 0;
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(loc_0, &v_0, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(i_0, &v_0, fx_result), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10make_identN10Ast__exp_t2SR10Ast__loc_t(
   fx_str_t* s_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_0 = {0};
   int fx_status = 0;
   _fx_R9Ast__id_t v_1;
   FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(s_0, &v_1, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(loc_0, &v_0, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&v_1, &v_0, fx_result), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10make_tupleN10Ast__exp_t2LN10Ast__exp_tR10Ast__loc_t(
   struct _fx_LN10Ast__exp_t_data_t* el_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_0 = {0};
   int fx_status = 0;
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(loc_0, &v_0, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM10ExpMkTupleN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(el_0, &v_0, fx_result), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10get_stringS2N10Ast__lit_tR10Ast__loc_t(
   struct _fx_N10Ast__lit_t* lit_0,
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (lit_0->tag == 5) {
      fx_copy_str(&lit_0->u.LitString, fx_result);
   }
   else {
      fx_exn_t v_0 = {0};
      fx_str_t slit_0 = FX_MAKE_STR("string literal is expected");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(loc_0, &slit_0, &v_0), _fx_catch_0);
      FX_THROW(&v_0, true, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM8pat2exp_T2N10Ast__pat_tN10Ast__exp_t1N10Ast__pat_t(
   struct _fx_N10Ast__pat_t_data_t* p_0,
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(p_0);
   if (tag_0 == 1) {
      _fx_N10Ast__pat_t v_0 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_1 = {0};
      _fx_N10Ast__exp_t v_2 = 0;
      _fx_R10Ast__loc_t* loc_0 = &p_0->u.PatAny;
      _fx_R9Ast__id_t param_id_0;
      fx_str_t slit_0 = FX_MAKE_STR("__pat__");
      FX_CALL(_fx_M3AstFM6gen_idRM4id_t2iS(_fx_g18Parser__parser_ctx.m_idx, &slit_0, &param_id_0, 0), _fx_catch_0);
      FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&param_id_0, loc_0, &v_0), _fx_catch_0);
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(loc_0, &v_1, 0), _fx_catch_0);
      FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&param_id_0, &v_1, &v_2), _fx_catch_0);
      _fx_make_T2N10Ast__pat_tN10Ast__exp_t(v_0, v_2, fx_result);

   _fx_catch_0: ;
      if (v_2) {
         _fx_free_N10Ast__exp_t(&v_2);
      }
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_1);
      if (v_0) {
         _fx_free_N10Ast__pat_t(&v_0);
      }
   }
   else if (tag_0 == 3) {
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_3 = {0};
      _fx_N10Ast__exp_t v_4 = 0;
      _fx_T2R9Ast__id_tR10Ast__loc_t* vcase_0 = &p_0->u.PatIdent;
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&vcase_0->t1, &v_3, 0), _fx_catch_1);
      FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&vcase_0->t0, &v_3, &v_4), _fx_catch_1);
      _fx_make_T2N10Ast__pat_tN10Ast__exp_t(p_0, v_4, fx_result);

   _fx_catch_1: ;
      if (v_4) {
         _fx_free_N10Ast__exp_t(&v_4);
      }
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_3);
   }
   else if (tag_0 == 8) {
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_5 = {0};
      _fx_N10Ast__exp_t v_6 = 0;
      _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* vcase_1 = &p_0->u.PatAs;
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&vcase_1->t2, &v_5, 0), _fx_catch_2);
      FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&vcase_1->t1, &v_5, &v_6), _fx_catch_2);
      _fx_make_T2N10Ast__pat_tN10Ast__exp_t(vcase_1->t0, v_6, fx_result);

   _fx_catch_2: ;
      if (v_6) {
         _fx_free_N10Ast__exp_t(&v_6);
      }
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_5);
   }
   else if (tag_0 == 9) {
      _fx_T2N10Ast__pat_tN10Ast__exp_t v_7 = {0};
      _fx_N10Ast__pat_t p_1 = 0;
      _fx_N10Ast__exp_t e_0 = 0;
      _fx_N10Ast__pat_t v_8 = 0;
      _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* vcase_2 = &p_0->u.PatTyped;
      FX_CALL(_fx_M6ParserFM8pat2exp_T2N10Ast__pat_tN10Ast__exp_t1N10Ast__pat_t(vcase_2->t0, &v_7, 0), _fx_catch_3);
      FX_COPY_PTR(v_7.t0, &p_1);
      FX_COPY_PTR(v_7.t1, &e_0);
      FX_CALL(_fx_M3AstFM8PatTypedN10Ast__pat_t3N10Ast__pat_tN10Ast__typ_tRM5loc_t(p_1, vcase_2->t1, &vcase_2->t2, &v_8),
         _fx_catch_3);
      _fx_make_T2N10Ast__pat_tN10Ast__exp_t(v_8, e_0, fx_result);

   _fx_catch_3: ;
      if (v_8) {
         _fx_free_N10Ast__pat_t(&v_8);
      }
      if (e_0) {
         _fx_free_N10Ast__exp_t(&e_0);
      }
      if (p_1) {
         _fx_free_N10Ast__pat_t(&p_1);
      }
      _fx_free_T2N10Ast__pat_tN10Ast__exp_t(&v_7);
   }
   else {
      _fx_N10Ast__pat_t v_9 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_10 = {0};
      _fx_N10Ast__exp_t v_11 = 0;
      _fx_R10Ast__loc_t loc_1;
      FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(p_0, &loc_1, 0), _fx_catch_4);
      _fx_R9Ast__id_t param_id_1;
      fx_str_t slit_1 = FX_MAKE_STR("__pat__");
      FX_CALL(_fx_M3AstFM6gen_idRM4id_t2iS(_fx_g18Parser__parser_ctx.m_idx, &slit_1, &param_id_1, 0), _fx_catch_4);
      FX_CALL(_fx_M3AstFM5PatAsN10Ast__pat_t3N10Ast__pat_tRM4id_tRM5loc_t(p_0, &param_id_1, &loc_1, &v_9), _fx_catch_4);
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&loc_1, &v_10, 0), _fx_catch_4);
      FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&param_id_1, &v_10, &v_11), _fx_catch_4);
      _fx_make_T2N10Ast__pat_tN10Ast__exp_t(v_9, v_11, fx_result);

   _fx_catch_4: ;
      if (v_11) {
         _fx_free_N10Ast__exp_t(&v_11);
      }
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_10);
      if (v_9) {
         _fx_free_N10Ast__pat_t(&v_9);
      }
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM9plist2expT2LN10Ast__pat_tN10Ast__exp_t2LN10Ast__pat_tR10Ast__loc_t(
   struct _fx_LN10Ast__pat_t_data_t* pl_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LN10Ast__pat_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LN10Ast__pat_tLN10Ast__exp_t __fold_result___0 = {0};
   _fx_T2LN10Ast__pat_tLN10Ast__exp_t v_0 = {0};
   _fx_LN10Ast__pat_t plist_0 = 0;
   _fx_LN10Ast__exp_t elist_0 = 0;
   _fx_LN10Ast__pat_t __fold_result___1 = 0;
   _fx_LN10Ast__pat_t v_1 = 0;
   _fx_N10Ast__exp_t v_2 = 0;
   int fx_status = 0;
   _fx_make_T2LN10Ast__pat_tLN10Ast__exp_t(0, 0, &__fold_result___0);
   _fx_LN10Ast__pat_t lst_0 = pl_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_T2LN10Ast__pat_tLN10Ast__exp_t v_3 = {0};
      _fx_LN10Ast__pat_t plist_1 = 0;
      _fx_LN10Ast__exp_t elist_1 = 0;
      _fx_T2N10Ast__pat_tN10Ast__exp_t v_4 = {0};
      _fx_N10Ast__pat_t p__0 = 0;
      _fx_N10Ast__exp_t e__0 = 0;
      _fx_T2LN10Ast__pat_tLN10Ast__exp_t v_5 = {0};
      _fx_N10Ast__pat_t p_0 = lst_0->hd;
      _fx_copy_T2LN10Ast__pat_tLN10Ast__exp_t(&__fold_result___0, &v_3);
      FX_COPY_PTR(v_3.t0, &plist_1);
      FX_COPY_PTR(v_3.t1, &elist_1);
      FX_CALL(_fx_M6ParserFM8pat2exp_T2N10Ast__pat_tN10Ast__exp_t1N10Ast__pat_t(p_0, &v_4, 0), _fx_catch_0);
      FX_COPY_PTR(v_4.t0, &p__0);
      FX_COPY_PTR(v_4.t1, &e__0);
      FX_CALL(_fx_cons_LN10Ast__pat_t(p__0, plist_1, false, &plist_1), _fx_catch_0);
      FX_CALL(_fx_cons_LN10Ast__exp_t(e__0, elist_1, false, &elist_1), _fx_catch_0);
      _fx_make_T2LN10Ast__pat_tLN10Ast__exp_t(plist_1, elist_1, &v_5);
      _fx_free_T2LN10Ast__pat_tLN10Ast__exp_t(&__fold_result___0);
      _fx_copy_T2LN10Ast__pat_tLN10Ast__exp_t(&v_5, &__fold_result___0);

   _fx_catch_0: ;
      _fx_free_T2LN10Ast__pat_tLN10Ast__exp_t(&v_5);
      if (e__0) {
         _fx_free_N10Ast__exp_t(&e__0);
      }
      if (p__0) {
         _fx_free_N10Ast__pat_t(&p__0);
      }
      _fx_free_T2N10Ast__pat_tN10Ast__exp_t(&v_4);
      if (elist_1) {
         _fx_free_LN10Ast__exp_t(&elist_1);
      }
      if (plist_1) {
         _fx_free_LN10Ast__pat_t(&plist_1);
      }
      _fx_free_T2LN10Ast__pat_tLN10Ast__exp_t(&v_3);
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LN10Ast__pat_tLN10Ast__exp_t(&__fold_result___0, &v_0);
   FX_COPY_PTR(v_0.t0, &plist_0);
   FX_COPY_PTR(v_0.t1, &elist_0);
   _fx_LN10Ast__pat_t lst_1 = plist_0;
   for (; lst_1; lst_1 = lst_1->tl) {
      _fx_LN10Ast__pat_t r_0 = 0;
      _fx_N10Ast__pat_t a_0 = lst_1->hd;
      FX_COPY_PTR(__fold_result___1, &r_0);
      FX_CALL(_fx_cons_LN10Ast__pat_t(a_0, r_0, false, &r_0), _fx_catch_1);
      _fx_free_LN10Ast__pat_t(&__fold_result___1);
      FX_COPY_PTR(r_0, &__fold_result___1);

   _fx_catch_1: ;
      if (r_0) {
         _fx_free_LN10Ast__pat_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___1, &v_1);
   if (elist_0 != 0) {
      if (elist_0->tl == 0) {
         FX_COPY_PTR(elist_0->hd, &v_2); goto _fx_endmatch_0;
      }
   }
   _fx_LN10Ast__exp_t __fold_result___2 = 0;
   _fx_LN10Ast__exp_t v_6 = 0;
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_7 = {0};
   _fx_LN10Ast__exp_t lst_2 = elist_0;
   for (; lst_2; lst_2 = lst_2->tl) {
      _fx_LN10Ast__exp_t r_1 = 0;
      _fx_N10Ast__exp_t a_1 = lst_2->hd;
      FX_COPY_PTR(__fold_result___2, &r_1);
      FX_CALL(_fx_cons_LN10Ast__exp_t(a_1, r_1, false, &r_1), _fx_catch_2);
      _fx_free_LN10Ast__exp_t(&__fold_result___2);
      FX_COPY_PTR(r_1, &__fold_result___2);

   _fx_catch_2: ;
      if (r_1) {
         _fx_free_LN10Ast__exp_t(&r_1);
      }
      FX_CHECK_EXN(_fx_catch_3);
   }
   FX_COPY_PTR(__fold_result___2, &v_6);
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(loc_0, &v_7, 0), _fx_catch_3);
   FX_CALL(_fx_M3AstFM10ExpMkTupleN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_6, &v_7, &v_2), _fx_catch_3);

_fx_catch_3: ;
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_7);
   if (v_6) {
      _fx_free_LN10Ast__exp_t(&v_6);
   }
   if (__fold_result___2) {
      _fx_free_LN10Ast__exp_t(&__fold_result___2);
   }

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   _fx_make_T2LN10Ast__pat_tN10Ast__exp_t(v_1, v_2, fx_result);

_fx_cleanup: ;
   _fx_free_T2LN10Ast__pat_tLN10Ast__exp_t(&__fold_result___0);
   _fx_free_T2LN10Ast__pat_tLN10Ast__exp_t(&v_0);
   if (plist_0) {
      _fx_free_LN10Ast__pat_t(&plist_0);
   }
   if (elist_0) {
      _fx_free_LN10Ast__exp_t(&elist_0);
   }
   if (__fold_result___1) {
      _fx_free_LN10Ast__pat_t(&__fold_result___1);
   }
   if (v_1) {
      _fx_free_LN10Ast__pat_t(&v_1);
   }
   if (v_2) {
      _fx_free_N10Ast__exp_t(&v_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM18transform_fold_expN10Ast__exp_t6SN10Ast__pat_tN10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
   fx_str_t* special_0,
   struct _fx_N10Ast__pat_t_data_t* fold_pat_0,
   struct _fx_N10Ast__exp_t_data_t* fold_init_exp_0,
   struct _fx_N10Ast__exp_t_data_t* for_exp_0,
   struct _fx_N10Ast__exp_t_data_t* for_iter_exp_0,
   struct _fx_R10Ast__loc_t* fold_loc_0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_0 = {0};
   _fx_N10Ast__exp_t fr_exp_0 = 0;
   _fx_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t result_0 = {0};
   _fx_N10Ast__exp_t e_0 = 0;
   _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t result_1 = 0;
   _fx_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t v_1 = {0};
   _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t nested_fors_0 = 0;
   _fx_N10Ast__exp_t fold_body_0 = 0;
   _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t result_2 = {0};
   _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t __pat___0 = 0;
   _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t v_2 = {0};
   _fx_T2N10Ast__typ_tR10Ast__loc_t void_ctx_0 = {0};
   _fx_T2N10Ast__typ_tR10Ast__loc_t bool_ctx_0 = {0};
   _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t v_3 = {0};
   _fx_N10Ast__exp_t fr_decl_0 = 0;
   _fx_N10Ast__exp_t new_body_0 = 0;
   _fx_N10Ast__exp_t fr_exp_1 = 0;
   int fx_status = 0;
   _fx_R10Ast__loc_t acc_loc_0;
   FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(fold_pat_0, &acc_loc_0, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&acc_loc_0, &v_0, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&_fx_g23Ast__std__fold_result__, &v_0, &fr_exp_0),
      _fx_cleanup);
   FX_COPY_PTR(for_exp_0, &e_0);
   for (;;) {
      _fx_N10Ast__exp_t e_1 = 0;
      _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t result_3 = 0;
      FX_COPY_PTR(e_0, &e_1);
      FX_COPY_PTR(result_1, &result_3);
      if (FX_REC_VARIANT_TAG(e_1) == 26) {
         _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* vcase_0 =
            &e_1->u.ExpFor;
         _fx_R16Ast__for_flags_t* flags_0 = &vcase_0->t3;
         bool t_0;
         if (result_3 == 0) {
            t_0 = true;
         }
         else {
            t_0 = flags_0->for_flag_nested;
         }
         if (t_0) {
            _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t v_4 = {0};
            _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t v_5 = 0;
            _fx_make_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(vcase_0->t0, vcase_0->t1,
               flags_0, &vcase_0->t4, &v_4);
            FX_CALL(
               _fx_cons_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&v_4, result_3, true,
                  &v_5), _fx_catch_0);
            _fx_N10Ast__exp_t* body_0 = &vcase_0->t2;
            _fx_free_N10Ast__exp_t(&e_0);
            FX_COPY_PTR(*body_0, &e_0);
            _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&result_1);
            FX_COPY_PTR(v_5, &result_1);

         _fx_catch_0: ;
            if (v_5) {
               _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&v_5);
            }
            _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&v_4);
            goto _fx_endmatch_0;
         }
      }
      _fx_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t result_4 = {0};
      _fx_make_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(result_3, e_1,
         &result_4);
      _fx_free_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(&result_0);
      _fx_copy_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(&result_4,
         &result_0);
      FX_BREAK(_fx_catch_1);

   _fx_catch_1: ;
      _fx_free_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(&result_4);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_2);

   _fx_catch_2: ;
      if (result_3) {
         _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&result_3);
      }
      if (e_1) {
         _fx_free_N10Ast__exp_t(&e_1);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(&result_0, &v_1);
   FX_COPY_PTR(v_1.t0, &nested_fors_0);
   FX_COPY_PTR(v_1.t1, &fold_body_0);
   FX_COPY_PTR(nested_fors_0, &__pat___0);
   for (;;) {
      _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t __pat___1 = 0;
      FX_COPY_PTR(__pat___0, &__pat___1);
      if (__pat___1 != 0) {
         if (__pat___1->tl == 0) {
            _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t result_5 = {0};
            _fx_copy_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&__pat___1->hd, &result_5);
            _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&result_2);
            _fx_copy_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&result_5, &result_2);
            FX_BREAK(_fx_catch_3);

         _fx_catch_3: ;
            _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&result_5);
            goto _fx_endmatch_1;
         }
      }
      if (__pat___1 != 0) {
         _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t* rest_0 = &__pat___1->tl;
         _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&__pat___0);
         FX_COPY_PTR(*rest_0, &__pat___0);
         goto _fx_endmatch_1;
      }
      FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_4);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_4);

   _fx_catch_4: ;
      if (__pat___1) {
         _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&__pat___1);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&result_2, &v_2);
   _fx_R16Ast__for_flags_t global_flags_0 = v_2.t2;
   _fx_R10Ast__loc_t body_loc_0;
   FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(fold_body_0, &body_loc_0, 0), _fx_cleanup);
   _fx_R10Ast__loc_t body_end_loc_0;
   FX_CALL(_fx_M3AstFM11get_end_locRM5loc_t1RM5loc_t(&body_loc_0, &body_end_loc_0, 0), _fx_cleanup);
   _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypVoid, &body_loc_0, &void_ctx_0);
   _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypBool, &body_loc_0, &bool_ctx_0);
   fx_str_t slit_0 = FX_MAKE_STR("");
   if (fx_streq(special_0, &slit_0)) {
      _fx_N10Ast__pat_t v_6 = 0;
      _fx_R16Ast__val_flags_t v_7 = {0};
      _fx_N10Ast__exp_t fr_decl_1 = 0;
      _fx_R16Ast__val_flags_t v_8 = {0};
      _fx_N10Ast__exp_t acc_decl_0 = 0;
      _fx_N10Ast__exp_t update_fr_0 = 0;
      _fx_LN10Ast__exp_t v_9 = 0;
      _fx_N10Ast__exp_t new_body_1 = 0;
      FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&_fx_g23Ast__std__fold_result__, &acc_loc_0, &v_6),
         _fx_catch_5);
      FX_CALL(_fx_M3AstFM17default_var_flagsRM11val_flags_t0(&v_7, 0), _fx_catch_5);
      FX_CALL(
         _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(v_6, fold_init_exp_0, &v_7,
            &acc_loc_0, &fr_decl_1), _fx_catch_5);
      FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_8, 0), _fx_catch_5);
      FX_CALL(
         _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(fold_pat_0, fr_exp_0, &v_8,
            &acc_loc_0, &acc_decl_0), _fx_catch_5);
      FX_CALL(
         _fx_M3AstFM9ExpAssignN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tRM5loc_t(fr_exp_0, fold_body_0, &body_loc_0,
            &update_fr_0), _fx_catch_5);
      FX_CALL(_fx_cons_LN10Ast__exp_t(update_fr_0, 0, true, &v_9), _fx_catch_5);
      FX_CALL(_fx_cons_LN10Ast__exp_t(acc_decl_0, v_9, false, &v_9), _fx_catch_5);
      FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_9, &void_ctx_0, &new_body_1),
         _fx_catch_5);
      _fx_make_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t(fr_decl_1, new_body_1, fr_exp_0, &global_flags_0,
         &v_3);

   _fx_catch_5: ;
      if (new_body_1) {
         _fx_free_N10Ast__exp_t(&new_body_1);
      }
      if (v_9) {
         _fx_free_LN10Ast__exp_t(&v_9);
      }
      if (update_fr_0) {
         _fx_free_N10Ast__exp_t(&update_fr_0);
      }
      if (acc_decl_0) {
         _fx_free_N10Ast__exp_t(&acc_decl_0);
      }
      _fx_free_R16Ast__val_flags_t(&v_8);
      if (fr_decl_1) {
         _fx_free_N10Ast__exp_t(&fr_decl_1);
      }
      _fx_free_R16Ast__val_flags_t(&v_7);
      if (v_6) {
         _fx_free_N10Ast__pat_t(&v_6);
      }
      goto _fx_endmatch_5;
   }
   bool res_0;
   fx_str_t slit_1 = FX_MAKE_STR("all");
   if (fx_streq(special_0, &slit_1)) {
      res_0 = true; goto _fx_endmatch_2;
   }
   fx_str_t slit_2 = FX_MAKE_STR("exists");
   if (fx_streq(special_0, &slit_2)) {
      res_0 = true; goto _fx_endmatch_2;
   }
   res_0 = false;

_fx_endmatch_2: ;
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      _fx_N10Ast__pat_t v_10 = 0;
      _fx_N10Ast__lit_t v_11 = {0};
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_12 = {0};
      _fx_N10Ast__exp_t v_13 = 0;
      _fx_R16Ast__val_flags_t v_14 = {0};
      _fx_N10Ast__exp_t fr_decl_2 = 0;
      _fx_N10Ast__lit_t v_15 = {0};
      _fx_N10Ast__exp_t v_16 = 0;
      _fx_N10Ast__exp_t v_17 = 0;
      _fx_N10Ast__exp_t v_18 = 0;
      _fx_LN10Ast__exp_t v_19 = 0;
      _fx_N10Ast__exp_t break_exp_0 = 0;
      _fx_N10Ast__exp_t predicate_exp_0 = 0;
      _fx_N10Ast__exp_t v_20 = 0;
      _fx_N10Ast__exp_t new_body_2 = 0;
      bool is_all_0;
      fx_str_t slit_3 = FX_MAKE_STR("all");
      is_all_0 = _fx_F6__eq__B2SS(special_0, &slit_3, 0);
      FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&_fx_g23Ast__std__fold_result__, &acc_loc_0, &v_10),
         _fx_catch_6);
      _fx_M3AstFM7LitBoolN10Ast__lit_t1B(is_all_0, &v_11);
      _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypBool, &acc_loc_0, &v_12);
      FX_CALL(_fx_M3AstFM6ExpLitN10Ast__exp_t2N10Ast__lit_tT2N10Ast__typ_tRM5loc_t(&v_11, &v_12, &v_13), _fx_catch_6);
      FX_CALL(_fx_M3AstFM17default_var_flagsRM11val_flags_t0(&v_14, 0), _fx_catch_6);
      FX_CALL(
         _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(v_10, v_13, &v_14, &acc_loc_0,
            &fr_decl_2), _fx_catch_6);
      _fx_M3AstFM7LitBoolN10Ast__lit_t1B(!is_all_0, &v_15);
      FX_CALL(_fx_M3AstFM6ExpLitN10Ast__exp_t2N10Ast__lit_tT2N10Ast__typ_tRM5loc_t(&v_15, &bool_ctx_0, &v_16), _fx_catch_6);
      FX_CALL(_fx_M3AstFM9ExpAssignN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tRM5loc_t(fr_exp_0, v_16, &body_loc_0, &v_17),
         _fx_catch_6);
      FX_CALL(_fx_M3AstFM8ExpBreakN10Ast__exp_t2BRM5loc_t(true, &body_loc_0, &v_18), _fx_catch_6);
      FX_CALL(_fx_cons_LN10Ast__exp_t(v_18, 0, true, &v_19), _fx_catch_6);
      FX_CALL(_fx_cons_LN10Ast__exp_t(v_17, v_19, false, &v_19), _fx_catch_6);
      FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_19, &void_ctx_0, &break_exp_0),
         _fx_catch_6);
      if (!is_all_0) {
         FX_COPY_PTR(fold_body_0, &predicate_exp_0);
      }
      else {
         FX_CALL(
            _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g18Parser__OpLogicNot,
               fold_body_0, &bool_ctx_0, &predicate_exp_0), _fx_catch_6);
      }
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&body_loc_0, &v_20), _fx_catch_6);
      FX_CALL(
         _fx_M3AstFM5ExpIfN10Ast__exp_t4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(predicate_exp_0,
            break_exp_0, v_20, &void_ctx_0, &new_body_2), _fx_catch_6);
      _fx_make_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t(fr_decl_2, new_body_2, fr_exp_0, &global_flags_0,
         &v_3);

   _fx_catch_6: ;
      if (new_body_2) {
         _fx_free_N10Ast__exp_t(&new_body_2);
      }
      if (v_20) {
         _fx_free_N10Ast__exp_t(&v_20);
      }
      if (predicate_exp_0) {
         _fx_free_N10Ast__exp_t(&predicate_exp_0);
      }
      if (break_exp_0) {
         _fx_free_N10Ast__exp_t(&break_exp_0);
      }
      if (v_19) {
         _fx_free_LN10Ast__exp_t(&v_19);
      }
      if (v_18) {
         _fx_free_N10Ast__exp_t(&v_18);
      }
      if (v_17) {
         _fx_free_N10Ast__exp_t(&v_17);
      }
      if (v_16) {
         _fx_free_N10Ast__exp_t(&v_16);
      }
      _fx_free_N10Ast__lit_t(&v_15);
      if (fr_decl_2) {
         _fx_free_N10Ast__exp_t(&fr_decl_2);
      }
      _fx_free_R16Ast__val_flags_t(&v_14);
      if (v_13) {
         _fx_free_N10Ast__exp_t(&v_13);
      }
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_12);
      _fx_free_N10Ast__lit_t(&v_11);
      if (v_10) {
         _fx_free_N10Ast__pat_t(&v_10);
      }
      goto _fx_endmatch_5;
   }
   bool res_1;
   fx_str_t slit_4 = FX_MAKE_STR("find");
   if (fx_streq(special_0, &slit_4)) {
      res_1 = true; goto _fx_endmatch_3;
   }
   fx_str_t slit_5 = FX_MAKE_STR("find_opt");
   if (fx_streq(special_0, &slit_5)) {
      res_1 = true; goto _fx_endmatch_3;
   }
   res_1 = false;

_fx_endmatch_3: ;
   FX_CHECK_EXN(_fx_cleanup);
   if (res_1) {
      _fx_N10Ast__pat_t v_21 = 0;
      _fx_N10Ast__exp_t v_22 = 0;
      _fx_R16Ast__val_flags_t v_23 = {0};
      _fx_N10Ast__exp_t fr_decl_3 = 0;
      _fx_N10Ast__exp_t v_24 = 0;
      _fx_LN10Ast__exp_t v_25 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_26 = {0};
      _fx_N10Ast__exp_t mksome_exp_0 = 0;
      _fx_N10Ast__exp_t v_27 = 0;
      _fx_N10Ast__exp_t v_28 = 0;
      _fx_LN10Ast__exp_t v_29 = 0;
      _fx_N10Ast__exp_t break_exp_1 = 0;
      _fx_N10Ast__exp_t v_30 = 0;
      _fx_N10Ast__exp_t new_body_3 = 0;
      _fx_N10Ast__exp_t new_fr_exp_0 = 0;
      _fx_R9Ast__id_t none_0;
      fx_str_t slit_6 = FX_MAKE_STR("None");
      FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_6, &none_0, 0), _fx_catch_8);
      _fx_R9Ast__id_t some_0;
      fx_str_t slit_7 = FX_MAKE_STR("Some");
      FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_7, &some_0, 0), _fx_catch_8);
      FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&_fx_g23Ast__std__fold_result__, &acc_loc_0, &v_21),
         _fx_catch_8);
      FX_CALL(_fx_M6ParserFM10make_identN10Ast__exp_t2R9Ast__id_tR10Ast__loc_t(&none_0, &acc_loc_0, &v_22, 0), _fx_catch_8);
      FX_CALL(_fx_M3AstFM17default_var_flagsRM11val_flags_t0(&v_23, 0), _fx_catch_8);
      FX_CALL(
         _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(v_21, v_22, &v_23, &acc_loc_0,
            &fr_decl_3), _fx_catch_8);
      FX_CALL(_fx_M6ParserFM10make_identN10Ast__exp_t2R9Ast__id_tR10Ast__loc_t(&some_0, &body_loc_0, &v_24, 0), _fx_catch_8);
      FX_CALL(_fx_cons_LN10Ast__exp_t(for_iter_exp_0, 0, true, &v_25), _fx_catch_8);
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&body_loc_0, &v_26, 0), _fx_catch_8);
      FX_CALL(
         _fx_M3AstFM7ExpCallN10Ast__exp_t3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_24, v_25, &v_26, &mksome_exp_0),
         _fx_catch_8);
      FX_CALL(_fx_M3AstFM9ExpAssignN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tRM5loc_t(fr_exp_0, mksome_exp_0, &body_loc_0, &v_27),
         _fx_catch_8);
      FX_CALL(_fx_M3AstFM8ExpBreakN10Ast__exp_t2BRM5loc_t(true, &body_loc_0, &v_28), _fx_catch_8);
      FX_CALL(_fx_cons_LN10Ast__exp_t(v_28, 0, true, &v_29), _fx_catch_8);
      FX_CALL(_fx_cons_LN10Ast__exp_t(v_27, v_29, false, &v_29), _fx_catch_8);
      FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_29, &void_ctx_0, &break_exp_1),
         _fx_catch_8);
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&body_loc_0, &v_30), _fx_catch_8);
      FX_CALL(
         _fx_M3AstFM5ExpIfN10Ast__exp_t4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(fold_body_0, break_exp_1,
            v_30, &void_ctx_0, &new_body_3), _fx_catch_8);
      fx_str_t slit_8 = FX_MAKE_STR("find");
      if (fx_streq(special_0, &slit_8)) {
         _fx_N10Ast__pat_t v_31 = 0;
         _fx_LN10Ast__pat_t v_32 = 0;
         _fx_N10Ast__pat_t v_33 = 0;
         _fx_N10Ast__exp_t v_34 = 0;
         _fx_T2N10Ast__pat_tN10Ast__exp_t some_case_0 = {0};
         _fx_N10Ast__pat_t v_35 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_36 = {0};
         _fx_N10Ast__exp_t v_37 = 0;
         _fx_N10Ast__exp_t v_38 = 0;
         _fx_T2N10Ast__pat_tN10Ast__exp_t none_case_0 = {0};
         _fx_LT2N10Ast__pat_tN10Ast__exp_t v_39 = 0;
         _fx_N10Ast__typ_t v_40 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_41 = {0};
         _fx_R9Ast__id_t x_0;
         fx_str_t slit_9 = FX_MAKE_STR("x");
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_9, &x_0, 0), _fx_catch_7);
         FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&x_0, &body_end_loc_0, &v_31), _fx_catch_7);
         FX_CALL(_fx_cons_LN10Ast__pat_t(v_31, 0, true, &v_32), _fx_catch_7);
         FX_CALL(_fx_M3AstFM10PatVariantN10Ast__pat_t3RM4id_tLN10Ast__pat_tRM5loc_t(&some_0, v_32, &body_end_loc_0, &v_33),
            _fx_catch_7);
         FX_CALL(_fx_M6ParserFM10make_identN10Ast__exp_t2R9Ast__id_tR10Ast__loc_t(&x_0, &body_end_loc_0, &v_34, 0),
            _fx_catch_7);
         _fx_make_T2N10Ast__pat_tN10Ast__exp_t(v_33, v_34, &some_case_0);
         FX_CALL(_fx_M3AstFM6PatAnyN10Ast__pat_t1RM5loc_t(&body_end_loc_0, &v_35), _fx_catch_7);
         _fx_R9Ast__id_t v_42;
         fx_str_t slit_10 = FX_MAKE_STR("NotFoundError");
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_10, &v_42, 0), _fx_catch_7);
         _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g14Parser__TypExn, &body_end_loc_0, &v_36);
         FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&v_42, &v_36, &v_37), _fx_catch_7);
         FX_CALL(_fx_M3AstFM8ExpThrowN10Ast__exp_t2N10Ast__exp_tRM5loc_t(v_37, &body_end_loc_0, &v_38), _fx_catch_7);
         _fx_make_T2N10Ast__pat_tN10Ast__exp_t(v_35, v_38, &none_case_0);
         FX_CALL(_fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(&none_case_0, 0, true, &v_39), _fx_catch_7);
         FX_CALL(_fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(&some_case_0, v_39, false, &v_39), _fx_catch_7);
         FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_40, 0), _fx_catch_7);
         _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_40, &body_end_loc_0, &v_41);
         FX_CALL(
            _fx_M3AstFM8ExpMatchN10Ast__exp_t3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(fr_exp_0, v_39,
               &v_41, &new_fr_exp_0), _fx_catch_7);

      _fx_catch_7: ;
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_41);
         if (v_40) {
            _fx_free_N10Ast__typ_t(&v_40);
         }
         if (v_39) {
            _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&v_39);
         }
         _fx_free_T2N10Ast__pat_tN10Ast__exp_t(&none_case_0);
         if (v_38) {
            _fx_free_N10Ast__exp_t(&v_38);
         }
         if (v_37) {
            _fx_free_N10Ast__exp_t(&v_37);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_36);
         if (v_35) {
            _fx_free_N10Ast__pat_t(&v_35);
         }
         _fx_free_T2N10Ast__pat_tN10Ast__exp_t(&some_case_0);
         if (v_34) {
            _fx_free_N10Ast__exp_t(&v_34);
         }
         if (v_33) {
            _fx_free_N10Ast__pat_t(&v_33);
         }
         if (v_32) {
            _fx_free_LN10Ast__pat_t(&v_32);
         }
         if (v_31) {
            _fx_free_N10Ast__pat_t(&v_31);
         }
         goto _fx_endmatch_4;
      }
      FX_COPY_PTR(fr_exp_0, &new_fr_exp_0);

   _fx_endmatch_4: ;
      FX_CHECK_EXN(_fx_catch_8);
      _fx_make_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t(fr_decl_3, new_body_3, new_fr_exp_0,
         &global_flags_0, &v_3);

   _fx_catch_8: ;
      if (new_fr_exp_0) {
         _fx_free_N10Ast__exp_t(&new_fr_exp_0);
      }
      if (new_body_3) {
         _fx_free_N10Ast__exp_t(&new_body_3);
      }
      if (v_30) {
         _fx_free_N10Ast__exp_t(&v_30);
      }
      if (break_exp_1) {
         _fx_free_N10Ast__exp_t(&break_exp_1);
      }
      if (v_29) {
         _fx_free_LN10Ast__exp_t(&v_29);
      }
      if (v_28) {
         _fx_free_N10Ast__exp_t(&v_28);
      }
      if (v_27) {
         _fx_free_N10Ast__exp_t(&v_27);
      }
      if (mksome_exp_0) {
         _fx_free_N10Ast__exp_t(&mksome_exp_0);
      }
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_26);
      if (v_25) {
         _fx_free_LN10Ast__exp_t(&v_25);
      }
      if (v_24) {
         _fx_free_N10Ast__exp_t(&v_24);
      }
      if (fr_decl_3) {
         _fx_free_N10Ast__exp_t(&fr_decl_3);
      }
      _fx_free_R16Ast__val_flags_t(&v_23);
      if (v_22) {
         _fx_free_N10Ast__exp_t(&v_22);
      }
      if (v_21) {
         _fx_free_N10Ast__pat_t(&v_21);
      }
      goto _fx_endmatch_5;
   }
   fx_str_t slit_11 = FX_MAKE_STR("filter");
   if (fx_streq(special_0, &slit_11)) {
      _fx_N10Ast__exp_t v_43 = 0;
      _fx_N10Ast__exp_t v_44 = 0;
      _fx_N10Ast__exp_t v_45 = 0;
      _fx_N10Ast__exp_t check_exp_0 = 0;
      _fx_LN10Ast__exp_t v_46 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_47 = {0};
      _fx_N10Ast__exp_t new_body_4 = 0;
      _fx_N10Ast__exp_t v_48 = 0;
      _fx_N10Ast__exp_t v_49 = 0;
      FX_CALL(
         _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g18Parser__OpLogicNot,
            fold_body_0, &bool_ctx_0, &v_43), _fx_catch_9);
      FX_CALL(_fx_M3AstFM11ExpContinueN10Ast__exp_t1RM5loc_t(&body_loc_0, &v_44), _fx_catch_9);
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&body_loc_0, &v_45), _fx_catch_9);
      FX_CALL(
         _fx_M3AstFM5ExpIfN10Ast__exp_t4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_43, v_44, v_45,
            &void_ctx_0, &check_exp_0), _fx_catch_9);
      FX_CALL(_fx_cons_LN10Ast__exp_t(for_iter_exp_0, 0, true, &v_46), _fx_catch_9);
      FX_CALL(_fx_cons_LN10Ast__exp_t(check_exp_0, v_46, false, &v_46), _fx_catch_9);
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&body_loc_0, &v_47, 0), _fx_catch_9);
      FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_46, &v_47, &new_body_4), _fx_catch_9);
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&body_loc_0, &v_48), _fx_catch_9);
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&body_loc_0, &v_49), _fx_catch_9);
      _fx_R16Ast__for_flags_t v_50 =
         { global_flags_0.for_flag_parallel, _fx_g19Parser__ForMakeList, global_flags_0.for_flag_unzip,
            global_flags_0.for_flag_fold, global_flags_0.for_flag_nested };
      _fx_make_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t(v_48, new_body_4, v_49, &v_50, &v_3);

   _fx_catch_9: ;
      if (v_49) {
         _fx_free_N10Ast__exp_t(&v_49);
      }
      if (v_48) {
         _fx_free_N10Ast__exp_t(&v_48);
      }
      if (new_body_4) {
         _fx_free_N10Ast__exp_t(&new_body_4);
      }
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_47);
      if (v_46) {
         _fx_free_LN10Ast__exp_t(&v_46);
      }
      if (check_exp_0) {
         _fx_free_N10Ast__exp_t(&check_exp_0);
      }
      if (v_45) {
         _fx_free_N10Ast__exp_t(&v_45);
      }
      if (v_44) {
         _fx_free_N10Ast__exp_t(&v_44);
      }
      if (v_43) {
         _fx_free_N10Ast__exp_t(&v_43);
      }
      goto _fx_endmatch_5;
   }
   fx_str_t slit_12 = FX_MAKE_STR("vector");
   if (fx_streq(special_0, &slit_12)) {
      _fx_N10Ast__exp_t v_51 = 0;
      _fx_N10Ast__exp_t v_52 = 0;
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&body_loc_0, &v_51), _fx_catch_10);
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&body_loc_0, &v_52), _fx_catch_10);
      _fx_R16Ast__for_flags_t v_53 =
         { global_flags_0.for_flag_parallel, _fx_g21Parser__ForMakeVector, global_flags_0.for_flag_unzip,
            global_flags_0.for_flag_fold, global_flags_0.for_flag_nested };
      _fx_make_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t(v_51, fold_body_0, v_52, &v_53, &v_3);

   _fx_catch_10: ;
      if (v_52) {
         _fx_free_N10Ast__exp_t(&v_52);
      }
      if (v_51) {
         _fx_free_N10Ast__exp_t(&v_51);
      }
      goto _fx_endmatch_5;
   }
   fx_str_t v_54 = {0};
   fx_exn_t v_55 = {0};
   fx_str_t slit_13 = FX_MAKE_STR("unknown fold variation \'");
   fx_str_t slit_14 = FX_MAKE_STR("\'");
   {
      const fx_str_t strs_0[] = { slit_13, *special_0, slit_14 };
      FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_54), _fx_catch_11);
   }
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&acc_loc_0, &v_54, &v_55), _fx_catch_11);
   FX_THROW(&v_55, true, _fx_catch_11);

_fx_catch_11: ;
   fx_free_exn(&v_55);
   FX_FREE_STR(&v_54);

_fx_endmatch_5: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_3.t0, &fr_decl_0);
   FX_COPY_PTR(v_3.t1, &new_body_0);
   FX_COPY_PTR(v_3.t2, &fr_exp_1);
   _fx_R16Ast__for_flags_t global_flags_1 = v_3.t3;
   _fx_N15Ast__for_make_t v_56 = global_flags_1.for_flag_make;
   if (v_56.tag == 1) {
      _fx_N10Ast__exp_t __fold_result___0 = 0;
      _fx_N10Ast__exp_t for_exp_1 = 0;
      _fx_LN10Ast__exp_t v_57 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_58 = {0};
      FX_COPY_PTR(new_body_0, &__fold_result___0);
      _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t lst_0 = nested_fors_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_LT2N10Ast__pat_tN10Ast__exp_t pe_l_0 = 0;
         _fx_N10Ast__pat_t idxp_0 = 0;
         _fx_N10Ast__exp_t for_exp_2 = 0;
         _fx_N10Ast__exp_t v_59 = 0;
         _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t* __pat___2 = &lst_0->hd;
         FX_COPY_PTR(__pat___2->t0, &pe_l_0);
         FX_COPY_PTR(__pat___2->t1, &idxp_0);
         _fx_R16Ast__for_flags_t flags_1 = __pat___2->t2;
         _fx_R10Ast__loc_t loc_0 = __pat___2->t3;
         FX_COPY_PTR(__fold_result___0, &for_exp_2);
         _fx_R16Ast__for_flags_t v_60 =
            { flags_1.for_flag_parallel, flags_1.for_flag_make, flags_1.for_flag_unzip, true, flags_1.for_flag_nested };
         FX_CALL(
            _fx_M3AstFM6ExpForN10Ast__exp_t5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tRM11for_flags_tRM5loc_t(
               pe_l_0, idxp_0, for_exp_2, &v_60, &loc_0, &v_59), _fx_catch_12);
         _fx_free_N10Ast__exp_t(&__fold_result___0);
         FX_COPY_PTR(v_59, &__fold_result___0);

      _fx_catch_12: ;
         if (v_59) {
            _fx_free_N10Ast__exp_t(&v_59);
         }
         if (for_exp_2) {
            _fx_free_N10Ast__exp_t(&for_exp_2);
         }
         if (idxp_0) {
            _fx_free_N10Ast__pat_t(&idxp_0);
         }
         if (pe_l_0) {
            _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&pe_l_0);
         }
         FX_CHECK_EXN(_fx_catch_13);
      }
      FX_COPY_PTR(__fold_result___0, &for_exp_1);
      FX_CALL(_fx_cons_LN10Ast__exp_t(fr_exp_1, 0, true, &v_57), _fx_catch_13);
      FX_CALL(_fx_cons_LN10Ast__exp_t(for_exp_1, v_57, false, &v_57), _fx_catch_13);
      FX_CALL(_fx_cons_LN10Ast__exp_t(fr_decl_0, v_57, false, &v_57), _fx_catch_13);
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(fold_loc_0, &v_58, 0), _fx_catch_13);
      FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_57, &v_58, fx_result), _fx_catch_13);

   _fx_catch_13: ;
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_58);
      if (v_57) {
         _fx_free_LN10Ast__exp_t(&v_57);
      }
      if (for_exp_1) {
         _fx_free_N10Ast__exp_t(&for_exp_1);
      }
      if (__fold_result___0) {
         _fx_free_N10Ast__exp_t(&__fold_result___0);
      }
   }
   else {
      _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t __fold_result___1 = 0;
      _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t nd_map_0 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_61 = {0};
      _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t lst_1 = nested_fors_0;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_LT2N10Ast__pat_tN10Ast__exp_t pe_l_1 = 0;
         _fx_N10Ast__pat_t idxp_1 = 0;
         _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t nd_map_1 = 0;
         _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t v_62 = {0};
         _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t* __pat___3 = &lst_1->hd;
         FX_COPY_PTR(__pat___3->t0, &pe_l_1);
         FX_COPY_PTR(__pat___3->t1, &idxp_1);
         FX_COPY_PTR(__fold_result___1, &nd_map_1);
         _fx_make_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(pe_l_1, idxp_1, &v_62);
         FX_CALL(_fx_cons_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&v_62, nd_map_1, false, &nd_map_1), _fx_catch_14);
         _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&__fold_result___1);
         FX_COPY_PTR(nd_map_1, &__fold_result___1);

      _fx_catch_14: ;
         _fx_free_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&v_62);
         if (nd_map_1) {
            _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&nd_map_1);
         }
         if (idxp_1) {
            _fx_free_N10Ast__pat_t(&idxp_1);
         }
         if (pe_l_1) {
            _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&pe_l_1);
         }
         FX_CHECK_EXN(_fx_catch_15);
      }
      FX_COPY_PTR(__fold_result___1, &nd_map_0);
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(fold_loc_0, &v_61, 0), _fx_catch_15);
      FX_CALL(
         _fx_M3AstFM6ExpMapN10Ast__exp_t4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tRM11for_flags_tT2N10Ast__typ_tRM5loc_t(
            nd_map_0, new_body_0, &global_flags_1, &v_61, fx_result), _fx_catch_15);

   _fx_catch_15: ;
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_61);
      if (nd_map_0) {
         _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&nd_map_0);
      }
      if (__fold_result___1) {
         _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&__fold_result___1);
      }
   }

_fx_cleanup: ;
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_0);
   if (fr_exp_0) {
      _fx_free_N10Ast__exp_t(&fr_exp_0);
   }
   _fx_free_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(&result_0);
   if (e_0) {
      _fx_free_N10Ast__exp_t(&e_0);
   }
   if (result_1) {
      _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&result_1);
   }
   _fx_free_T2LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_tN10Ast__exp_t(&v_1);
   if (nested_fors_0) {
      _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&nested_fors_0);
   }
   if (fold_body_0) {
      _fx_free_N10Ast__exp_t(&fold_body_0);
   }
   _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&result_2);
   if (__pat___0) {
      _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&__pat___0);
   }
   _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tR16Ast__for_flags_tR10Ast__loc_t(&v_2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&void_ctx_0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&bool_ctx_0);
   _fx_free_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR16Ast__for_flags_t(&v_3);
   if (fr_decl_0) {
      _fx_free_N10Ast__exp_t(&fr_decl_0);
   }
   if (new_body_0) {
      _fx_free_N10Ast__exp_t(&new_body_0);
   }
   if (fr_exp_1) {
      _fx_free_N10Ast__exp_t(&fr_exp_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   fx_str_t* msg_0,
   fx_exn_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_R10Ast__loc_t loc_0;
   if (ts_0 != 0) {
      loc_0 = ts_0->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_cleanup);
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, msg_0, fx_result), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10expseq2expN10Ast__exp_t2LN10Ast__exp_tR10Ast__loc_t(
   struct _fx_LN10Ast__exp_t_data_t* eseq_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (eseq_0 == 0) {
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(loc_0, fx_result), _fx_catch_0);  _fx_catch_0: ; goto _fx_endmatch_0;
   }
   if (eseq_0 != 0) {
      if (eseq_0->tl == 0) {
         FX_COPY_PTR(eseq_0->hd, fx_result); goto _fx_endmatch_0;
      }
   }
   _fx_LR10Ast__loc_t llist_0 = 0;
   _fx_N10Ast__typ_t v_0 = 0;
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_1 = {0};
   _fx_LR10Ast__loc_t lstend_0 = 0;
   _fx_LN10Ast__exp_t lst_0 = eseq_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N10Ast__exp_t e_0 = lst_0->hd;
      _fx_R10Ast__loc_t res_0;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_0, &res_0, 0), _fx_catch_1);
      _fx_LR10Ast__loc_t node_0 = 0;
      FX_CALL(_fx_cons_LR10Ast__loc_t(&res_0, 0, false, &node_0), _fx_catch_1);
      FX_LIST_APPEND(llist_0, lstend_0, node_0);

   _fx_catch_1: ;
      FX_CHECK_EXN(_fx_catch_2);
   }
   _fx_R10Ast__loc_t loc_1;
   FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(llist_0, loc_0, &loc_1, 0), _fx_catch_2);
   FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_0, 0), _fx_catch_2);
   _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_0, &loc_1, &v_1);
   FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(eseq_0, &v_1, fx_result), _fx_catch_2);

_fx_catch_2: ;
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_1);
   if (v_0) {
      _fx_free_N10Ast__typ_t(&v_0);
   }
   FX_FREE_LIST_SIMPLE(&llist_0);

_fx_endmatch_0: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM11match_parenT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN14Lexer__token_tR10Ast__loc_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* arg0_0,
   struct _fx_N14Lexer__token_t* ct_0,
   struct _fx_R10Ast__loc_t* ol_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_0 = 0;
   _fx_N10Ast__exp_t e_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(arg0_0->t0, &ts_0);
   FX_COPY_PTR(arg0_0->t1, &e_0);
   if (ts_0 != 0) {
      bool res_0;
      FX_CALL(_fx_M6ParserFM15__eq_variants__B2N14Lexer__token_tN14Lexer__token_t(&ts_0->hd.t0, ct_0, &res_0, 0), _fx_cleanup);
      if (res_0) {
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_0->tl, e_0, fx_result); goto _fx_endmatch_0;
      }
   }
   _fx_Ta2S v_0 = {0};
   fx_str_t v_1 = {0};
   fx_str_t v_2 = {0};
   fx_str_t v_3 = {0};
   fx_exn_t v_4 = {0};
   FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(ct_0, &v_0, 0), _fx_catch_0);
   fx_copy_str(&v_0.t1, &v_1);
   FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(ol_0, &v_2, 0), _fx_catch_0);
   fx_str_t slit_0 = FX_MAKE_STR("\'");
   fx_str_t slit_1 = FX_MAKE_STR("\' is expected; the opening paren is here ");
   {
      const fx_str_t strs_0[] = { slit_0, v_1, slit_1, v_2 };
      FX_CALL(fx_strjoin(0, 0, 0, strs_0, 4, &v_3), _fx_catch_0);
   }
   _fx_R10Ast__loc_t loc_0;
   if (ts_0 != 0) {
      loc_0 = ts_0->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_0);
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &v_3, &v_4), _fx_catch_0);
   FX_THROW(&v_4, true, _fx_catch_0);

_fx_catch_0: ;
   fx_free_exn(&v_4);
   FX_FREE_STR(&v_3);
   FX_FREE_STR(&v_2);
   FX_FREE_STR(&v_1);
   _fx_free_Ta2S(&v_0);

_fx_endmatch_0: ;

_fx_cleanup: ;
   if (ts_0) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_0);
   }
   if (e_0) {
      _fx_free_N10Ast__exp_t(&e_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM12is_for_startB1N14Lexer__token_t(struct _fx_N14Lexer__token_t* t_0, bool* fx_result, void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = t_0->tag;
   bool res_0;
   if (tag_0 == 19) {
      res_0 = true;
   }
   else if (tag_0 == 29) {
      res_0 = true;
   }
   else if (tag_0 == 43) {
      res_0 = true;
   }
   else {
      res_0 = false;
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      *fx_result = true; goto _fx_endmatch_0;
   }
   *fx_result = false;

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM8check_nev2BLT2N14Lexer__token_tR10Ast__loc_t(
   bool ne_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   void* fx_fv)
{
   fx_exn_t v_0 = {0};
   int fx_status = 0;
   if (!ne_0) {
      _fx_R10Ast__loc_t loc_0;
      if (ts_0 != 0) {
         loc_0 = ts_0->hd.t1;
      }
      else {
         loc_0 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_cleanup);
      fx_str_t slit_0 = FX_MAKE_STR("new line or \';\' is expected before new expression");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_cleanup);
      FX_THROW(&v_0, true, _fx_cleanup);
   }

_fx_cleanup: ;
   fx_free_exn(&v_0);
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM16parse_exp_list_fT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t6LT2N14Lexer__token_tR10Ast__loc_tFPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts0_0,
   struct _fx_FPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t* parse_exp_f_0,
   struct _fx_N14Lexer__token_t* ct_0,
   struct _fx_N17Parser__kw_mode_t* kw_mode_0,
   bool allow_empty_0,
   bool stop_at_semicolon_0,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_0 = 0;
   _fx_LN10Ast__exp_t el_0 = 0;
   _fx_LT2R9Ast__id_tN10Ast__exp_t kw_el_0 = 0;
   fx_exn_t v_1 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM15parse_exp_list_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t9LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tN14Lexer__token_tN17Parser__kw_mode_tFPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_tBLT2N14Lexer__token_tR10Ast__loc_t(
         ts0_0, false, 0, 0, ct_0, kw_mode_0, parse_exp_f_0, stop_at_semicolon_0, ts0_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_0);
   bool f_0 = v_0.t1;
   FX_COPY_PTR(v_0.t2, &el_0);
   FX_COPY_PTR(v_0.t3, &kw_el_0);
   bool t_0;
   if (!allow_empty_0) {
      t_0 = el_0 == 0;
   }
   else {
      t_0 = false;
   }
   bool t_1;
   if (t_0) {
      t_1 = kw_el_0 == 0;
   }
   else {
      t_1 = false;
   }
   if (t_1) {
      _fx_R10Ast__loc_t loc_0;
      if (ts_0 != 0) {
         loc_0 = ts_0->hd.t1;
      }
      else {
         loc_0 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_cleanup);
      fx_str_t slit_0 = FX_MAKE_STR("empty expression list is not allowed here");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_1), _fx_cleanup);
      FX_THROW(&v_1, true, _fx_cleanup);
   }
   _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(ts_0, f_0, el_0, kw_el_0, fx_result);

_fx_cleanup: ;
   _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&v_0);
   if (ts_0) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_0);
   }
   if (el_0) {
      _fx_free_LN10Ast__exp_t(&el_0);
   }
   if (kw_el_0) {
      _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&kw_el_0);
   }
   fx_free_exn(&v_1);
   return fx_status;
}

static int
   _fx_M6ParserFM15parse_exp_list_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t9LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tN14Lexer__token_tN17Parser__kw_mode_tFPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_tBLT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LN10Ast__exp_t_data_t* el_0,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* kw_el_0,
   struct _fx_N14Lexer__token_t* ct_0,
   struct _fx_N17Parser__kw_mode_t* kw_mode_0,
   struct _fx_FPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t* parse_exp_f_0,
   bool stop_at_semicolon_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts0_0,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t result_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__exp_t el_1 = 0;
   _fx_LT2R9Ast__id_tN10Ast__exp_t kw_el_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(el_0, &el_1);
   FX_COPY_PTR(kw_el_0, &kw_el_1);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LN10Ast__exp_t el_2 = 0;
      _fx_LT2R9Ast__id_tN10Ast__exp_t kw_el_2 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(el_1, &el_2);
      FX_COPY_PTR(kw_el_1, &kw_el_2);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               _fx_free_LN10Ast__exp_t(&el_1);
               FX_COPY_PTR(el_2, &el_1);
               _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&kw_el_1);
               FX_COPY_PTR(kw_el_2, &kw_el_1);
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_1;
         }
      }
      if (ts_2 != 0) {
         bool res_0;
         FX_CALL(_fx_M6ParserFM15__eq_variants__B2N14Lexer__token_tN14Lexer__token_t(&ts_2->hd.t0, ct_0, &res_0, 0),
            _fx_catch_11);
         if (res_0) {
            _fx_LN10Ast__exp_t __fold_result___0 = 0;
            _fx_LN10Ast__exp_t v_1 = 0;
            _fx_LT2R9Ast__id_tN10Ast__exp_t __fold_result___1 = 0;
            _fx_LT2R9Ast__id_tN10Ast__exp_t v_2 = 0;
            _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t result_1 = {0};
            _fx_LN10Ast__exp_t lst_0 = el_2;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_LN10Ast__exp_t r_0 = 0;
               _fx_N10Ast__exp_t a_0 = lst_0->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LN10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_1);
               _fx_free_LN10Ast__exp_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_1: ;
               if (r_0) {
                  _fx_free_LN10Ast__exp_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_3);
            }
            FX_COPY_PTR(__fold_result___0, &v_1);
            _fx_LT2R9Ast__id_tN10Ast__exp_t lst_1 = kw_el_2;
            for (; lst_1; lst_1 = lst_1->tl) {
               _fx_LT2R9Ast__id_tN10Ast__exp_t r_1 = 0;
               _fx_T2R9Ast__id_tN10Ast__exp_t* a_1 = &lst_1->hd;
               FX_COPY_PTR(__fold_result___1, &r_1);
               FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__exp_t(a_1, r_1, false, &r_1), _fx_catch_2);
               _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&__fold_result___1);
               FX_COPY_PTR(r_1, &__fold_result___1);

            _fx_catch_2: ;
               if (r_1) {
                  _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&r_1);
               }
               FX_CHECK_EXN(_fx_catch_3);
            }
            FX_COPY_PTR(__fold_result___1, &v_2);
            _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(ts_2->tl, true, v_1, v_2,
               &result_1);
            _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&result_0);
            _fx_copy_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&result_1, &result_0);
            FX_BREAK(_fx_catch_3);

         _fx_catch_3: ;
            _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&result_1);
            if (v_2) {
               _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&v_2);
            }
            if (__fold_result___1) {
               _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&__fold_result___1);
            }
            if (v_1) {
               _fx_free_LN10Ast__exp_t(&v_1);
            }
            if (__fold_result___0) {
               _fx_free_LN10Ast__exp_t(&__fold_result___0);
            }
            goto _fx_endmatch_1;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 53) {
            fx_exn_t v_3 = {0};
            _fx_LN10Ast__exp_t __fold_result___2 = 0;
            _fx_LN10Ast__exp_t v_4 = 0;
            _fx_LT2R9Ast__id_tN10Ast__exp_t __fold_result___3 = 0;
            _fx_LT2R9Ast__id_tN10Ast__exp_t v_5 = 0;
            _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t result_2 = {0};
            if (!stop_at_semicolon_0) {
               _fx_R10Ast__loc_t loc_1;
               if (ts_2 != 0) {
                  loc_1 = ts_2->hd.t1;
               }
               else {
                  loc_1 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_6);
               fx_str_t slit_1 = FX_MAKE_STR("unxpected \';\'");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_3), _fx_catch_6);
               FX_THROW(&v_3, true, _fx_catch_6);
            }
            _fx_LN10Ast__exp_t lst_2 = el_2;
            for (; lst_2; lst_2 = lst_2->tl) {
               _fx_LN10Ast__exp_t r_2 = 0;
               _fx_N10Ast__exp_t a_2 = lst_2->hd;
               FX_COPY_PTR(__fold_result___2, &r_2);
               FX_CALL(_fx_cons_LN10Ast__exp_t(a_2, r_2, false, &r_2), _fx_catch_4);
               _fx_free_LN10Ast__exp_t(&__fold_result___2);
               FX_COPY_PTR(r_2, &__fold_result___2);

            _fx_catch_4: ;
               if (r_2) {
                  _fx_free_LN10Ast__exp_t(&r_2);
               }
               FX_CHECK_EXN(_fx_catch_6);
            }
            FX_COPY_PTR(__fold_result___2, &v_4);
            _fx_LT2R9Ast__id_tN10Ast__exp_t lst_3 = kw_el_2;
            for (; lst_3; lst_3 = lst_3->tl) {
               _fx_LT2R9Ast__id_tN10Ast__exp_t r_3 = 0;
               _fx_T2R9Ast__id_tN10Ast__exp_t* a_3 = &lst_3->hd;
               FX_COPY_PTR(__fold_result___3, &r_3);
               FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__exp_t(a_3, r_3, false, &r_3), _fx_catch_5);
               _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&__fold_result___3);
               FX_COPY_PTR(r_3, &__fold_result___3);

            _fx_catch_5: ;
               if (r_3) {
                  _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&r_3);
               }
               FX_CHECK_EXN(_fx_catch_6);
            }
            FX_COPY_PTR(__fold_result___3, &v_5);
            _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(ts_2->tl, false, v_4, v_5,
               &result_2);
            _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&result_0);
            _fx_copy_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&result_2, &result_0);
            FX_BREAK(_fx_catch_6);

         _fx_catch_6: ;
            _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&result_2);
            if (v_5) {
               _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&v_5);
            }
            if (__fold_result___3) {
               _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&__fold_result___3);
            }
            if (v_4) {
               _fx_free_LN10Ast__exp_t(&v_4);
            }
            if (__fold_result___2) {
               _fx_free_LN10Ast__exp_t(&__fold_result___2);
            }
            fx_free_exn(&v_3);
            goto _fx_endmatch_1;
         }
      }
      if (ts_2 != 0) {
         fx_str_t semi_msg_0 = {0};
         _fx_Ta2S v_6 = {0};
         fx_str_t v_7 = {0};
         fx_str_t v_8 = {0};
         fx_exn_t v_9 = {0};
         if (expect_comma_2) {
            if (stop_at_semicolon_0) {
               fx_str_t slit_2 = FX_MAKE_STR("\';\' or "); fx_copy_str(&slit_2, &semi_msg_0);
            }
            else {
               fx_str_t slit_3 = FX_MAKE_STR(""); fx_copy_str(&slit_3, &semi_msg_0);
            }
            FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(ct_0, &v_6, 0), _fx_catch_9);
            fx_copy_str(&v_6.t1, &v_7);
            fx_str_t slit_4 = FX_MAKE_STR("\',\' or ");
            fx_str_t slit_5 = FX_MAKE_STR("\'");
            fx_str_t slit_6 = FX_MAKE_STR("\' is expected");
            {
               const fx_str_t strs_0[] = { slit_4, semi_msg_0, slit_5, v_7, slit_6 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_0, 5, &v_8), _fx_catch_9);
            }
            _fx_R10Ast__loc_t loc_2;
            if (ts_2 != 0) {
               loc_2 = ts_2->hd.t1;
            }
            else {
               loc_2 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_9);
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &v_8, &v_9), _fx_catch_9);
            FX_THROW(&v_9, true, _fx_catch_9);
         }
         if (ts_2 != 0) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_10 = ts_2->tl;
            if (v_10 != 0) {
               if (v_10->hd.t0.tag == 86) {
                  _fx_N14Lexer__token_t* v_11 = &ts_2->hd.t0;
                  if (v_11->tag == 2) {
                     fx_str_t v_12 = {0};
                     fx_exn_t v_13 = {0};
                     _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_14 = {0};
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
                     _fx_N10Ast__exp_t e_0 = 0;
                     _fx_T2R9Ast__id_tN10Ast__exp_t v_15 = {0};
                     _fx_LT2R9Ast__id_tN10Ast__exp_t v_16 = 0;
                     fx_str_t* i_0 = &v_11->u.IDENT.t1;
                     if (kw_mode_0->tag == 1) {
                        fx_str_t slit_7 = FX_MAKE_STR("unexpected keyword element \'");
                        fx_str_t slit_8 = FX_MAKE_STR("=...\'");
                        {
                           const fx_str_t strs_1[] = { slit_7, *i_0, slit_8 };
                           FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_12), _fx_catch_7);
                        }
                        _fx_R10Ast__loc_t loc_3;
                        if (ts_2 != 0) {
                           loc_3 = ts_2->hd.t1;
                        }
                        else {
                           loc_3 = _fx_g18Parser__parser_ctx.default_loc;
                        }
                        FX_CHECK_EXN(_fx_catch_7);
                        FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &v_12, &v_13), _fx_catch_7);
                        FX_THROW(&v_13, true, _fx_catch_7);
                     }
                     FX_CALL(
                        _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                           v_10->tl, &v_14, 0), _fx_catch_7);
                     FX_COPY_PTR(v_14.t0, &ts_3);
                     FX_COPY_PTR(v_14.t1, &e_0);
                     _fx_R9Ast__id_t v_17;
                     FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(i_0, &v_17, 0), _fx_catch_7);
                     _fx_make_T2R9Ast__id_tN10Ast__exp_t(&v_17, e_0, &v_15);
                     FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__exp_t(&v_15, kw_el_2, true, &v_16), _fx_catch_7);
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                     FX_COPY_PTR(ts_3, &ts_1);
                     expect_comma_1 = true;
                     _fx_free_LN10Ast__exp_t(&el_1);
                     FX_COPY_PTR(el_2, &el_1);
                     _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&kw_el_1);
                     FX_COPY_PTR(v_16, &kw_el_1);

                  _fx_catch_7: ;
                     if (v_16) {
                        _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&v_16);
                     }
                     _fx_free_T2R9Ast__id_tN10Ast__exp_t(&v_15);
                     if (e_0) {
                        _fx_free_N10Ast__exp_t(&e_0);
                     }
                     if (ts_3) {
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
                     }
                     _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_14);
                     fx_free_exn(&v_13);
                     FX_FREE_STR(&v_12);
                     goto _fx_endmatch_0;
                  }
               }
            }
         }
         fx_exn_t v_18 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_19 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_N10Ast__exp_t e_1 = 0;
         _fx_LN10Ast__exp_t v_20 = 0;
         if (kw_mode_0->tag == 3) {
            _fx_R10Ast__loc_t loc_4;
            if (ts_2 != 0) {
               loc_4 = ts_2->hd.t1;
            }
            else {
               loc_4 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_8);
            fx_str_t slit_9 = FX_MAKE_STR("expect a keyword element here \'<ident> = ...\'");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_4, &slit_9, &v_18), _fx_catch_8);
            FX_THROW(&v_18, true, _fx_catch_8);
         }
         FX_CALL(parse_exp_f_0->fp(ts_2, &v_19, parse_exp_f_0->fcv), _fx_catch_8);
         FX_COPY_PTR(v_19.t0, &ts_4);
         FX_COPY_PTR(v_19.t1, &e_1);
         FX_CALL(_fx_cons_LN10Ast__exp_t(e_1, el_2, true, &v_20), _fx_catch_8);
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         FX_COPY_PTR(ts_4, &ts_1);
         expect_comma_1 = true;
         _fx_free_LN10Ast__exp_t(&el_1);
         FX_COPY_PTR(v_20, &el_1);
         _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&kw_el_1);
         FX_COPY_PTR(kw_el_2, &kw_el_1);

      _fx_catch_8: ;
         if (v_20) {
            _fx_free_LN10Ast__exp_t(&v_20);
         }
         if (e_1) {
            _fx_free_N10Ast__exp_t(&e_1);
         }
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_19);
         fx_free_exn(&v_18);

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_9);

      _fx_catch_9: ;
         fx_free_exn(&v_9);
         FX_FREE_STR(&v_8);
         FX_FREE_STR(&v_7);
         _fx_free_Ta2S(&v_6);
         FX_FREE_STR(&semi_msg_0);
         goto _fx_endmatch_1;
      }
      fx_exn_t v_21 = {0};
      _fx_R10Ast__loc_t loc_5;
      if (ts0_0 != 0) {
         loc_5 = ts0_0->hd.t1;
      }
      else {
         loc_5 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_10);
      fx_str_t slit_10 = FX_MAKE_STR("the expression list is not complete by the end of file, check parentheses");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_5, &slit_10, &v_21), _fx_catch_10);
      FX_THROW(&v_21, true, _fx_catch_10);

   _fx_catch_10: ;
      fx_free_exn(&v_21);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_11);

   _fx_catch_11: ;
      if (kw_el_2) {
         _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&kw_el_2);
      }
      if (el_2) {
         _fx_free_LN10Ast__exp_t(&el_2);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&result_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (el_1) {
      _fx_free_LN10Ast__exp_t(&el_1);
   }
   if (kw_el_1) {
      _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&kw_el_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM14parse_exp_listT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t5LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts0_0,
   struct _fx_N14Lexer__token_t* ct_0,
   struct _fx_N17Parser__kw_mode_t* kw_mode_0,
   bool allow_empty_0,
   bool stop_at_semicolon_0,
   struct _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_FPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t parse_typed_exp_0 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_FPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t parse_typed_exp_fp_0 =
      { _fx_M6ParserFM15parse_typed_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t, 0 };
   FX_COPY_FP(&parse_typed_exp_fp_0, &parse_typed_exp_0);
   FX_CALL(
      _fx_M6ParserFM16parse_exp_list_fT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t6LT2N14Lexer__token_tR10Ast__loc_tFPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
         ts0_0, &parse_typed_exp_0, ct_0, kw_mode_0, allow_empty_0, stop_at_semicolon_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   FX_FREE_FP(&parse_typed_exp_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_dot_0,
   fx_str_t* result_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   fx_str_t result_2 = {0};
   int fx_status = 0;
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_dot_1 = expect_dot_0;
   fx_copy_str(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      fx_str_t result_3 = {0};
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_dot_2 = expect_dot_1;
      fx_copy_str(&result_2, &result_3);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 52) {
            fx_exn_t v_0 = {0};
            if (expect_dot_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_dot_1 = false;
               FX_FREE_STR(&result_2);
               fx_copy_str(&result_3, &result_2);
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \'.\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_0;
         }
      }
      if (expect_dot_2 == true) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS result_4 = {0};
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &result_3, &result_4);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tS(&result_4, &result_1);
         FX_BREAK(_fx_catch_1);

      _fx_catch_1: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&result_4);
         goto _fx_endmatch_0;
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_1 = &ts_2->hd.t0;
         if (v_1->tag == 2) {
            fx_str_t v_2 = {0};
            fx_str_t* i_0 = &v_1->u.IDENT.t1;
            if (FX_STR_LENGTH(result_3) == 0) {
               fx_copy_str(i_0, &v_2);
            }
            else {
               fx_str_t slit_1 = FX_MAKE_STR(".");
               {
                  const fx_str_t strs_0[] = { result_3, slit_1, *i_0 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_2), _fx_catch_2);
               }
            }
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &ts_2->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(*rest_1, &ts_1);
            expect_dot_1 = true;
            FX_FREE_STR(&result_2);
            fx_copy_str(&v_2, &result_2);

         _fx_catch_2: ;
            FX_FREE_STR(&v_2);
            goto _fx_endmatch_0;
         }
      }
      fx_exn_t v_3 = {0};
      _fx_R10Ast__loc_t loc_1;
      if (ts_2 != 0) {
         loc_1 = ts_2->hd.t1;
      }
      else {
         loc_1 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_3);
      fx_str_t slit_2 = FX_MAKE_STR("identifier is expected");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_2, &v_3), _fx_catch_3);
      FX_THROW(&v_3, true, _fx_catch_3);

   _fx_catch_3: ;
      fx_free_exn(&v_3);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_4);

   _fx_catch_4: ;
      FX_FREE_STR(&result_3);
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tS(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   FX_FREE_STR(&result_2);
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM16parse_ident_listT2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t4LT2N14Lexer__token_tR10Ast__loc_tBBLR9Ast__id_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   bool dot_idents_0,
   struct _fx_LR9Ast__id_t_data_t* result_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LR9Ast__id_t result_2 = 0;
   int fx_status = 0;
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   bool dot_idents_1 = dot_idents_0;
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LR9Ast__id_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      bool dot_idents_2 = dot_idents_1;
      FX_COPY_PTR(result_2, &result_3);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               dot_idents_1 = dot_idents_2;
               FX_FREE_LIST_SIMPLE(&result_2);
               FX_COPY_PTR(result_3, &result_2);
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_1 = &ts_2->hd.t0;
         if (v_1->tag == 2) {
            _fx_LR9Ast__id_t __fold_result___0 = 0;
            _fx_LR9Ast__id_t v_2 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t result_4 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS v_3 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
            fx_str_t i_0 = {0};
            _fx_LR9Ast__id_t v_4 = 0;
            if (expect_comma_2) {
               _fx_LR9Ast__id_t lst_0 = result_3;
               for (; lst_0; lst_0 = lst_0->tl) {
                  _fx_LR9Ast__id_t r_0 = 0;
                  _fx_R9Ast__id_t* a_0 = &lst_0->hd;
                  FX_COPY_PTR(__fold_result___0, &r_0);
                  FX_CALL(_fx_cons_LR9Ast__id_t(a_0, r_0, false, &r_0), _fx_catch_1);
                  FX_FREE_LIST_SIMPLE(&__fold_result___0);
                  FX_COPY_PTR(r_0, &__fold_result___0);

               _fx_catch_1: ;
                  FX_FREE_LIST_SIMPLE(&r_0);
                  FX_CHECK_EXN(_fx_catch_2);
               }
               FX_COPY_PTR(__fold_result___0, &v_2);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(ts_2, v_2, &result_4);
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_1);
               _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_4, &result_1);
               FX_BREAK(_fx_catch_2);
            }
            else {
               if (dot_idents_2) {
                  fx_str_t slit_1 = FX_MAKE_STR("");
                  FX_CALL(
                     _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(
                        ts_2, false, &slit_1, &v_3, 0), _fx_catch_2);
               }
               else {
                  _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2->tl, &v_1->u.IDENT.t1, &v_3);
               }
               FX_COPY_PTR(v_3.t0, &ts_3);
               fx_copy_str(&v_3.t1, &i_0);
               _fx_R9Ast__id_t v_5;
               FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&i_0, &v_5, 0), _fx_catch_2);
               FX_CALL(_fx_cons_LR9Ast__id_t(&v_5, result_3, true, &v_4), _fx_catch_2);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(ts_3, &ts_1);
               expect_comma_1 = true;
               dot_idents_1 = dot_idents_2;
               FX_FREE_LIST_SIMPLE(&result_2);
               FX_COPY_PTR(v_4, &result_2);
            }

         _fx_catch_2: ;
            FX_FREE_LIST_SIMPLE(&v_4);
            FX_FREE_STR(&i_0);
            if (ts_3) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&v_3);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_4);
            FX_FREE_LIST_SIMPLE(&v_2);
            FX_FREE_LIST_SIMPLE(&__fold_result___0);
            goto _fx_endmatch_0;
         }
      }
      fx_exn_t v_6 = {0};
      _fx_LR9Ast__id_t __fold_result___1 = 0;
      _fx_LR9Ast__id_t v_7 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t result_5 = {0};
      if (result_3 == 0) {
         _fx_R10Ast__loc_t loc_1;
         if (ts_2 != 0) {
            loc_1 = ts_2->hd.t1;
         }
         else {
            loc_1 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_4);
         fx_str_t slit_2 = FX_MAKE_STR("empty id list");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_2, &v_6), _fx_catch_4);
         FX_THROW(&v_6, true, _fx_catch_4);
      }
      _fx_LR9Ast__id_t lst_1 = result_3;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_LR9Ast__id_t r_1 = 0;
         _fx_R9Ast__id_t* a_1 = &lst_1->hd;
         FX_COPY_PTR(__fold_result___1, &r_1);
         FX_CALL(_fx_cons_LR9Ast__id_t(a_1, r_1, false, &r_1), _fx_catch_3);
         FX_FREE_LIST_SIMPLE(&__fold_result___1);
         FX_COPY_PTR(r_1, &__fold_result___1);

      _fx_catch_3: ;
         FX_FREE_LIST_SIMPLE(&r_1);
         FX_CHECK_EXN(_fx_catch_4);
      }
      FX_COPY_PTR(__fold_result___1, &v_7);
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(ts_2, v_7, &result_5);
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_1);
      _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_5, &result_1);
      FX_BREAK(_fx_catch_4);

   _fx_catch_4: ;
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_5);
      FX_FREE_LIST_SIMPLE(&v_7);
      FX_FREE_LIST_SIMPLE(&__fold_result___1);
      fx_free_exn(&v_6);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_5);

   _fx_catch_5: ;
      FX_FREE_LIST_SIMPLE(&result_3);
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   FX_FREE_LIST_SIMPLE(&result_2);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM13make_list_expN10Ast__exp_t2LN10Ast__exp_tR10Ast__loc_t(
   struct _fx_LN10Ast__exp_t_data_t* el_0,
   struct _fx_R10Ast__loc_t* l1_0,
   struct _fx_N10Ast__exp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N10Ast__typ_t v_0 = 0;
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_1 = {0};
   _fx_N10Ast__exp_t __fold_result___0 = 0;
   _fx_LN10Ast__exp_t __fold_result___1 = 0;
   _fx_LN10Ast__exp_t v_2 = 0;
   int fx_status = 0;
   FX_CALL(_fx_M3AstFM11get_lit_typN10Ast__typ_t1N10Ast__lit_t(&_fx_g16Parser__LitEmpty, &v_0, 0), _fx_cleanup);
   _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_0, l1_0, &v_1);
   FX_CALL(
      _fx_M3AstFM6ExpLitN10Ast__exp_t2N10Ast__lit_tT2N10Ast__typ_tRM5loc_t(&_fx_g16Parser__LitEmpty, &v_1, &__fold_result___0),
      _fx_cleanup);
   _fx_LN10Ast__exp_t lst_0 = el_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LN10Ast__exp_t r_0 = 0;
      _fx_N10Ast__exp_t a_0 = lst_0->hd;
      FX_COPY_PTR(__fold_result___1, &r_0);
      FX_CALL(_fx_cons_LN10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LN10Ast__exp_t(&__fold_result___1);
      FX_COPY_PTR(r_0, &__fold_result___1);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LN10Ast__exp_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___1, &v_2);
   _fx_LN10Ast__exp_t lst_1 = v_2;
   for (; lst_1; lst_1 = lst_1->tl) {
      _fx_N10Ast__exp_t mklist_e_0 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_3 = {0};
      _fx_N10Ast__exp_t v_4 = 0;
      _fx_N10Ast__exp_t e_0 = lst_1->hd;
      FX_COPY_PTR(__fold_result___0, &mklist_e_0);
      _fx_R10Ast__loc_t v_5;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_0, &v_5, 0), _fx_catch_1);
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_5, &v_3, 0), _fx_catch_1);
      FX_CALL(
         _fx_M3AstFM9ExpBinaryN10Ast__exp_t4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
            _fx_g14Parser__OpCons, e_0, mklist_e_0, &v_3, &v_4), _fx_catch_1);
      _fx_free_N10Ast__exp_t(&__fold_result___0);
      FX_COPY_PTR(v_4, &__fold_result___0);

   _fx_catch_1: ;
      if (v_4) {
         _fx_free_N10Ast__exp_t(&v_4);
      }
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_3);
      if (mklist_e_0) {
         _fx_free_N10Ast__exp_t(&mklist_e_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (v_0) {
      _fx_free_N10Ast__typ_t(&v_0);
   }
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_1);
   if (__fold_result___0) {
      _fx_free_N10Ast__exp_t(&__fold_result___0);
   }
   if (__fold_result___1) {
      _fx_free_LN10Ast__exp_t(&__fold_result___1);
   }
   if (v_2) {
      _fx_free_LN10Ast__exp_t(&v_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM16parse_atomic_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_0 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_1 = &v_0->t0;
      if (v_1->tag == 2) {
         fx_exn_t v_2 = {0};
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_3 = {0};
         _fx_N10Ast__exp_t v_4 = 0;
         _fx_T2BS* vcase_0 = &v_1->u.IDENT;
         if (!vcase_0->t0) {
            _fx_R10Ast__loc_t loc_0;
            if (ts_0 != 0) {
               loc_0 = ts_0->hd.t1;
            }
            else {
               loc_0 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_0);
            fx_str_t slit_0 = FX_MAKE_STR("new line or \';\' is expected before new expression");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_2), _fx_catch_0);
            FX_THROW(&v_2, true, _fx_catch_0);
         }
         _fx_R9Ast__id_t v_5;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&vcase_0->t1, &v_5, 0), _fx_catch_0);
         FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_0->t1, &v_3, 0), _fx_catch_0);
         FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&v_5, &v_3, &v_4), _fx_catch_0);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_0->tl, v_4, fx_result);

      _fx_catch_0: ;
         if (v_4) {
            _fx_free_N10Ast__exp_t(&v_4);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_3);
         fx_free_exn(&v_2);
         goto _fx_endmatch_2;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_6 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_7 = &v_6->t0;
      if (v_7->tag == 1) {
         _fx_N10Ast__typ_t v_8 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_9 = {0};
         _fx_N10Ast__exp_t v_10 = 0;
         _fx_N10Ast__lit_t* lit_0 = &v_7->u.LITERAL;
         FX_CALL(_fx_M3AstFM11get_lit_typN10Ast__typ_t1N10Ast__lit_t(lit_0, &v_8, 0), _fx_catch_1);
         _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_8, &v_6->t1, &v_9);
         FX_CALL(_fx_M3AstFM6ExpLitN10Ast__exp_t2N10Ast__lit_tT2N10Ast__typ_tRM5loc_t(lit_0, &v_9, &v_10), _fx_catch_1);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_0->tl, v_10, fx_result);

      _fx_catch_1: ;
         if (v_10) {
            _fx_free_N10Ast__exp_t(&v_10);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_9);
         if (v_8) {
            _fx_free_N10Ast__typ_t(&v_8);
         }
         goto _fx_endmatch_2;
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_11 = ts_0->tl;
      if (v_11 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_12 = v_11->tl;
         if (v_12 != 0) {
            if (v_12->hd.t0.tag == 46) {
               _fx_N14Lexer__token_t* v_13 = &ts_0->hd.t0;
               if (v_13->tag == 44) {
                  if (v_13->u.LPAREN == true) {
                     _fx_T2N14Lexer__token_tR10Ast__loc_t* v_14 = &v_11->hd;
                     _fx_N14Lexer__token_t* t_0 = &v_14->t0;
                     _fx_R9Ast__id_t v_15;
                     FX_CALL(_fx_M6ParserFM10get_opnameR9Ast__id_t1N14Lexer__token_t(t_0, &v_15, 0), _fx_cleanup);
                     bool res_0;
                     FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&v_15, &_fx_g9Ast__noid, &res_0, 0), _fx_cleanup);
                     if (!res_0) {
                        _fx_T2N10Ast__typ_tR10Ast__loc_t v_16 = {0};
                        _fx_N10Ast__exp_t v_17 = 0;
                        _fx_R9Ast__id_t opname_0;
                        FX_CALL(_fx_M6ParserFM10get_opnameR9Ast__id_t1N14Lexer__token_t(t_0, &opname_0, 0), _fx_catch_2);
                        FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_14->t1, &v_16, 0), _fx_catch_2);
                        FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&opname_0, &v_16, &v_17),
                           _fx_catch_2);
                        _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(v_12->tl, v_17, fx_result);

                     _fx_catch_2: ;
                        if (v_17) {
                           _fx_free_N10Ast__exp_t(&v_17);
                        }
                        _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_16);
                        goto _fx_endmatch_2;
                     }
                  }
               }
            }
         }
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_18 = ts_0->tl;
      if (v_18 != 0) {
         if (v_18->hd.t0.tag == 49) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_19 = &ts_0->hd;
            _fx_N14Lexer__token_t* v_20 = &v_19->t0;
            if (v_20->tag == 44) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_21 = 0;
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_22 = {0};
               FX_CALL(_fx_M6ParserFM8check_nev2BLT2N14Lexer__token_tR10Ast__loc_t(v_20->u.LPAREN, ts_0, 0), _fx_catch_3);
               FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0, &v_21, 0),
                  _fx_catch_3);
               FX_CALL(
                  _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                     v_21, &v_22, 0), _fx_catch_3);
               FX_CALL(
                  _fx_M6ParserFM11match_parenT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN14Lexer__token_tR10Ast__loc_t(
                     &v_22, &_fx_g14Parser__RPAREN, &v_19->t1, fx_result, 0), _fx_catch_3);

            _fx_catch_3: ;
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_22);
               if (v_21) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_21);
               }
               goto _fx_endmatch_2;
            }
         }
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_23 = ts_0->tl;
      if (v_23 != 0) {
         if (v_23->hd.t0.tag == 68) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_24 = &ts_0->hd;
            _fx_N14Lexer__token_t* v_25 = &v_24->t0;
            if (v_25->tag == 44) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_26 = 0;
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_27 = 0;
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_28 = {0};
               FX_CALL(_fx_M6ParserFM8check_nev2BLT2N14Lexer__token_tR10Ast__loc_t(v_25->u.LPAREN, ts_0, 0), _fx_catch_4);
               FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0, &v_26, 0),
                  _fx_catch_4);
               FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(v_26, &v_27, 0),
                  _fx_catch_4);
               FX_CALL(
                  _fx_M6ParserFM10parse_syncT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                     v_27, &v_28, 0), _fx_catch_4);
               FX_CALL(
                  _fx_M6ParserFM11match_parenT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN14Lexer__token_tR10Ast__loc_t(
                     &v_28, &_fx_g14Parser__RPAREN, &v_24->t1, fx_result, 0), _fx_catch_4);

            _fx_catch_4: ;
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_28);
               if (v_27) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_27);
               }
               if (v_26) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_26);
               }
               goto _fx_endmatch_2;
            }
         }
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 68) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_29 = 0;
         FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0, &v_29, 0),
            _fx_catch_5);
         FX_CALL(
            _fx_M6ParserFM10parse_syncT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(v_29,
               fx_result, 0), _fx_catch_5);

      _fx_catch_5: ;
         if (v_29) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_29);
         }
         goto _fx_endmatch_2;
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_30 = ts_0->tl;
      if (v_30 != 0) {
         if (v_30->hd.t0.tag == 19) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_31 = &ts_0->hd;
            _fx_N14Lexer__token_t* v_32 = &v_31->t0;
            if (v_32->tag == 44) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_33 = 0;
               _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t v_34 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
               _fx_N10Ast__exp_t for_exp_0 = 0;
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_35 = {0};
               FX_CALL(_fx_M6ParserFM8check_nev2BLT2N14Lexer__token_tR10Ast__loc_t(v_32->u.LPAREN, ts_0, 0), _fx_catch_6);
               FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0, &v_33, 0),
                  _fx_catch_6);
               FX_CALL(
                  _fx_M6ParserFM9parse_forT3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN15Ast__for_make_t(
                     v_33, &_fx_g20Parser__ForMakeTuple, &v_34, 0), _fx_catch_6);
               FX_COPY_PTR(v_34.t0, &ts_1);
               FX_COPY_PTR(v_34.t1, &for_exp_0);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1, for_exp_0, &v_35);
               FX_CALL(
                  _fx_M6ParserFM11match_parenT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN14Lexer__token_tR10Ast__loc_t(
                     &v_35, &_fx_g14Parser__RPAREN, &v_31->t1, fx_result, 0), _fx_catch_6);

            _fx_catch_6: ;
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_35);
               if (for_exp_0) {
                  _fx_free_N10Ast__exp_t(&for_exp_0);
               }
               if (ts_1) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               }
               _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(&v_34);
               if (v_33) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_33);
               }
               goto _fx_endmatch_2;
            }
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_36 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_37 = &v_36->t0;
      if (v_37->tag == 44) {
         _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t v_38 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
         _fx_LN10Ast__exp_t el_0 = 0;
         _fx_N10Ast__exp_t v_39 = 0;
         FX_CALL(_fx_M6ParserFM8check_nev2BLT2N14Lexer__token_tR10Ast__loc_t(v_37->u.LPAREN, ts_0, 0), _fx_catch_8);
         FX_CALL(
            _fx_M6ParserFM14parse_exp_listT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t5LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
               ts_0->tl, &_fx_g14Parser__RPAREN, &_fx_g14Parser__KwNone, false, false, &v_38, 0), _fx_catch_8);
         FX_COPY_PTR(v_38.t0, &ts_2);
         FX_COPY_PTR(v_38.t2, &el_0);
         if (el_0 != 0) {
            if (el_0->tl == 0) {
               FX_COPY_PTR(el_0->hd, &v_39); goto _fx_endmatch_0;
            }
         }
         FX_CALL(_fx_M6ParserFM10make_tupleN10Ast__exp_t2LN10Ast__exp_tR10Ast__loc_t(el_0, &v_36->t1, &v_39, 0), _fx_catch_7);

      _fx_catch_7: ;

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_8);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, v_39, fx_result);

      _fx_catch_8: ;
         if (v_39) {
            _fx_free_N10Ast__exp_t(&v_39);
         }
         if (el_0) {
            _fx_free_LN10Ast__exp_t(&el_0);
         }
         if (ts_2) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
         }
         _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&v_38);
         goto _fx_endmatch_2;
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_40 = ts_0->tl;
      if (v_40 != 0) {
         if (v_40->hd.t0.tag == 56) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_41 = v_40->tl;
            if (v_41 != 0) {
               _fx_T2N14Lexer__token_tR10Ast__loc_t* v_42 = &ts_0->hd;
               _fx_N14Lexer__token_t* v_43 = &v_42->t0;
               if (v_43->tag == 47) {
                  if (v_43->u.LSQUARE == true) {
                     int tag_0 = v_41->hd.t0.tag;
                     bool res_1;
                     bool res_2;
                     if (tag_0 == 19) {
                        res_2 = true;
                     }
                     else if (tag_0 == 29) {
                        res_2 = true;
                     }
                     else if (tag_0 == 43) {
                        res_2 = true;
                     }
                     else {
                        res_2 = false;
                     }
                     FX_CHECK_EXN(_fx_cleanup);
                     if (res_2) {
                        res_1 = true; goto _fx_endmatch_1;
                     }
                     res_1 = false;

                  _fx_endmatch_1: ;
                     FX_CHECK_EXN(_fx_cleanup);
                     if (res_1) {
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t v_44 = 0;
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t v_45 = 0;
                        _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t v_46 = {0};
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
                        _fx_N10Ast__exp_t for_exp_1 = 0;
                        _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_47 = {0};
                        FX_CALL(
                           _fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0, &v_44, 0),
                           _fx_catch_9);
                        FX_CALL(
                           _fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(v_44, &v_45, 0),
                           _fx_catch_9);
                        FX_CALL(
                           _fx_M6ParserFM9parse_forT3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN15Ast__for_make_t(
                              v_45, &_fx_g19Parser__ForMakeList, &v_46, 0), _fx_catch_9);
                        FX_COPY_PTR(v_46.t0, &ts_3);
                        FX_COPY_PTR(v_46.t1, &for_exp_1);
                        _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_3, for_exp_1, &v_47);
                        FX_CALL(
                           _fx_M6ParserFM11match_parenT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN14Lexer__token_tR10Ast__loc_t(
                              &v_47, &_fx_g15Parser__RSQUARE, &v_42->t1, fx_result, 0), _fx_catch_9);

                     _fx_catch_9: ;
                        _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_47);
                        if (for_exp_1) {
                           _fx_free_N10Ast__exp_t(&for_exp_1);
                        }
                        if (ts_3) {
                           _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
                        }
                        _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(&v_46);
                        if (v_45) {
                           _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_45);
                        }
                        if (v_44) {
                           _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_44);
                        }
                        goto _fx_endmatch_2;
                     }
                  }
               }
            }
         }
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_48 = ts_0->tl;
      if (v_48 != 0) {
         if (v_48->hd.t0.tag == 56) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_49 = &ts_0->hd;
            _fx_N14Lexer__token_t* v_50 = &v_49->t0;
            if (v_50->tag == 47) {
               if (v_50->u.LSQUARE == true) {
                  _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t v_51 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
                  _fx_LN10Ast__exp_t el_1 = 0;
                  _fx_N10Ast__exp_t v_52 = 0;
                  FX_CALL(
                     _fx_M6ParserFM14parse_exp_listT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t5LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
                        v_48->tl, &_fx_g15Parser__RSQUARE, &_fx_g14Parser__KwNone, true, false, &v_51, 0), _fx_catch_10);
                  FX_COPY_PTR(v_51.t0, &ts_4);
                  FX_COPY_PTR(v_51.t2, &el_1);
                  FX_CALL(_fx_M6ParserFM13make_list_expN10Ast__exp_t2LN10Ast__exp_tR10Ast__loc_t(el_1, &v_49->t1, &v_52, 0),
                     _fx_catch_10);
                  _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_4, v_52, fx_result);

               _fx_catch_10: ;
                  if (v_52) {
                     _fx_free_N10Ast__exp_t(&v_52);
                  }
                  if (el_1) {
                     _fx_free_LN10Ast__exp_t(&el_1);
                  }
                  if (ts_4) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
                  }
                  _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&v_51);
                  goto _fx_endmatch_2;
               }
            }
         }
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_53 = ts_0->tl;
      if (v_53 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_54 = &ts_0->hd;
         _fx_N14Lexer__token_t* v_55 = &v_54->t0;
         if (v_55->tag == 47) {
            if (v_55->u.LSQUARE == true) {
               bool res_3;
               FX_CALL(_fx_M6ParserFM12is_for_startB1N14Lexer__token_t(&v_53->hd.t0, &res_3, 0), _fx_cleanup);
               if (res_3) {
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t v_56 = 0;
                  _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t v_57 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
                  _fx_N10Ast__exp_t for_exp_2 = 0;
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_58 = {0};
                  FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0, &v_56, 0),
                     _fx_catch_11);
                  FX_CALL(
                     _fx_M6ParserFM9parse_forT3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN15Ast__for_make_t(
                        v_56, &_fx_g20Parser__ForMakeArray, &v_57, 0), _fx_catch_11);
                  FX_COPY_PTR(v_57.t0, &ts_5);
                  FX_COPY_PTR(v_57.t1, &for_exp_2);
                  _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_5, for_exp_2, &v_58);
                  FX_CALL(
                     _fx_M6ParserFM11match_parenT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN14Lexer__token_tR10Ast__loc_t(
                        &v_58, &_fx_g15Parser__RSQUARE, &v_54->t1, fx_result, 0), _fx_catch_11);

               _fx_catch_11: ;
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_58);
                  if (for_exp_2) {
                     _fx_free_N10Ast__exp_t(&for_exp_2);
                  }
                  if (ts_5) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
                  }
                  _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(&v_57);
                  if (v_56) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_56);
                  }
                  goto _fx_endmatch_2;
               }
            }
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_59 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_60 = &v_59->t0;
      if (v_60->tag == 47) {
         if (v_60->u.LSQUARE == true) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t vts_0 = 0;
            _fx_LLN10Ast__exp_t result_0 = 0;
            _fx_LLN10Ast__exp_t v_61 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_62 = {0};
            _fx_N10Ast__exp_t v_63 = 0;
            FX_COPY_PTR(ts_0->tl, &vts_0);
            for (;;) {
               _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t v_64 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
               _fx_LN10Ast__exp_t el_2 = 0;
               _fx_LLN10Ast__exp_t v_65 = 0;
               FX_CALL(
                  _fx_M6ParserFM14parse_exp_listT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t5LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
                     vts_0, &_fx_g15Parser__RSQUARE, &_fx_g14Parser__KwNone, false, true, &v_64, 0), _fx_catch_12);
               FX_COPY_PTR(v_64.t0, &ts_6);
               bool done_0 = v_64.t1;
               FX_COPY_PTR(v_64.t2, &el_2);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
               FX_COPY_PTR(ts_6, &vts_0);
               FX_CALL(_fx_cons_LLN10Ast__exp_t(el_2, result_0, true, &v_65), _fx_catch_12);
               _fx_free_LLN10Ast__exp_t(&result_0);
               FX_COPY_PTR(v_65, &result_0);
               if (done_0) {
                  FX_BREAK(_fx_catch_12);
               }

            _fx_catch_12: ;
               if (v_65) {
                  _fx_free_LLN10Ast__exp_t(&v_65);
               }
               if (el_2) {
                  _fx_free_LN10Ast__exp_t(&el_2);
               }
               if (ts_6) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
               }
               _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&v_64);
               FX_CHECK_BREAK();
               FX_CHECK_EXN(_fx_catch_13);
            }
            FX_CALL(_fx_M6ParserFM3revLLN10Ast__exp_t1LLN10Ast__exp_t(result_0, &v_61, 0), _fx_catch_13);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_59->t1, &v_62, 0), _fx_catch_13);
            FX_CALL(_fx_M3AstFM10ExpMkArrayN10Ast__exp_t2LLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_61, &v_62, &v_63),
               _fx_catch_13);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(vts_0, v_63, fx_result);

         _fx_catch_13: ;
            if (v_63) {
               _fx_free_N10Ast__exp_t(&v_63);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_62);
            if (v_61) {
               _fx_free_LLN10Ast__exp_t(&v_61);
            }
            if (result_0) {
               _fx_free_LLN10Ast__exp_t(&result_0);
            }
            if (vts_0) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
            }
            goto _fx_endmatch_2;
         }
      }
   }
   if (ts_0 != 0) {
      _fx_Ta2S v_66 = {0};
      fx_str_t v_67 = {0};
      fx_str_t v_68 = {0};
      fx_exn_t v_69 = {0};
      FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(&ts_0->hd.t0, &v_66, 0), _fx_catch_14);
      fx_copy_str(&v_66.t1, &v_67);
      fx_str_t slit_1 = FX_MAKE_STR("unxpected token \'");
      fx_str_t slit_2 =
         FX_MAKE_STR(
            "\'. An identifier, literal or expression enclosed in \'( )\', \'[ ]\' or \'[: :]\' brackets is expected here");
      {
         const fx_str_t strs_0[] = { slit_1, v_67, slit_2 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_68), _fx_catch_14);
      }
      FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_0, &v_68, &v_69, 0), _fx_catch_14);
      FX_THROW(&v_69, true, _fx_catch_14);

   _fx_catch_14: ;
      fx_free_exn(&v_69);
      FX_FREE_STR(&v_68);
      FX_FREE_STR(&v_67);
      _fx_free_Ta2S(&v_66);
      goto _fx_endmatch_2;
   }
   fx_exn_t v_70 = {0};
   fx_str_t slit_3 = FX_MAKE_STR("premature end of the stream; check the parens");
   FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_0, &slit_3, &v_70, 0), _fx_catch_15);
   FX_THROW(&v_70, true, _fx_catch_15);

_fx_catch_15: ;
   fx_free_exn(&v_70);

_fx_endmatch_2: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10__lambda__T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(
      _fx_M6ParserFM15parse_range_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0,
         false, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM16parse_simple_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t e_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM16parse_atomic_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
         &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &e_0);
   FX_CALL(
      _fx_M6ParserFM18extend_simple_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tB(
         ts_1, e_0, allow_mkrecord_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (e_0) {
      _fx_free_N10Ast__exp_t(&e_0);
   }
   return fx_status;
}

static int
   _fx_M6ParserFM18extend_simple_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N10Ast__exp_t_data_t* e_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t e_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(e_0, &e_1);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_N10Ast__exp_t e_2 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(e_1, &e_2);
      _fx_R10Ast__loc_t eloc_0;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_2, &eloc_0, 0), _fx_catch_43);
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_0 = ts_2->tl;
         if (v_0 != 0) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_1 = &ts_2->hd;
            _fx_N14Lexer__token_t* v_2 = &v_1->t0;
            if (v_2->tag == 44) {
               if (v_2->u.LPAREN == false) {
                  _fx_T2N14Lexer__token_tR10Ast__loc_t* v_3 = &v_0->hd;
                  bool res_0;
                  FX_CALL(_fx_M6ParserFM12is_for_startB1N14Lexer__token_t(&v_3->t0, &res_0, 0), _fx_catch_43);
                  if (res_0) {
                     fx_str_t istr_0 = {0};
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t v_4 = 0;
                     _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t v_5 = {0};
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
                     _fx_N10Ast__exp_t for_exp_0 = 0;
                     _fx_N10Ast__exp_t for_iter_exp_0 = 0;
                     _fx_N10Ast__pat_t v_6 = 0;
                     _fx_N10Ast__exp_t v_7 = 0;
                     _fx_N10Ast__exp_t fold_exp_0 = 0;
                     _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_8 = {0};
                     _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_9 = {0};
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
                     _fx_N10Ast__exp_t fold_exp_1 = 0;
                     _fx_R10Ast__loc_t eloc_1;
                     FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_2, &eloc_1, 0), _fx_catch_2);
                     if (FX_REC_VARIANT_TAG(e_2) == 7) {
                        FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&e_2->u.ExpIdent.t0, &istr_0, 0), _fx_catch_0);  _fx_catch_0: ;
                     }
                     else {
                        fx_exn_t v_10 = {0};
                        fx_str_t slit_0 = FX_MAKE_STR("incorrect use of for (\';\' or newline or maybe \'fold\' is missing?)");
                        FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&v_3->t1, &slit_0, &v_10), _fx_catch_1);
                        FX_THROW(&v_10, true, _fx_catch_1);

                     _fx_catch_1: ;
                        fx_free_exn(&v_10);
                     }
                     FX_CHECK_EXN(_fx_catch_2);
                     FX_CALL(
                        _fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_4, 0),
                        _fx_catch_2);
                     FX_CALL(
                        _fx_M6ParserFM9parse_forT3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN15Ast__for_make_t(
                           v_4, &_fx_g19Parser__ForMakeNone, &v_5, 0), _fx_catch_2);
                     FX_COPY_PTR(v_5.t0, &ts_3);
                     FX_COPY_PTR(v_5.t1, &for_exp_0);
                     FX_COPY_PTR(v_5.t2, &for_iter_exp_0);
                     FX_CALL(_fx_M3AstFM6PatAnyN10Ast__pat_t1RM5loc_t(&eloc_1, &v_6), _fx_catch_2);
                     FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&eloc_1, &v_7), _fx_catch_2);
                     FX_CALL(
                        _fx_M6ParserFM18transform_fold_expN10Ast__exp_t6SN10Ast__pat_tN10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
                           &istr_0, v_6, v_7, for_exp_0, for_iter_exp_0, &eloc_1, &fold_exp_0, 0), _fx_catch_2);
                     _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_3, fold_exp_0, &v_8);
                     FX_CALL(
                        _fx_M6ParserFM11match_parenT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN14Lexer__token_tR10Ast__loc_t(
                           &v_8, &_fx_g14Parser__RPAREN, &v_1->t1, &v_9, 0), _fx_catch_2);
                     FX_COPY_PTR(v_9.t0, &ts_4);
                     FX_COPY_PTR(v_9.t1, &fold_exp_1);
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                     FX_COPY_PTR(ts_4, &ts_1);
                     _fx_free_N10Ast__exp_t(&e_1);
                     FX_COPY_PTR(fold_exp_1, &e_1);

                  _fx_catch_2: ;
                     if (fold_exp_1) {
                        _fx_free_N10Ast__exp_t(&fold_exp_1);
                     }
                     if (ts_4) {
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
                     }
                     _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_9);
                     _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_8);
                     if (fold_exp_0) {
                        _fx_free_N10Ast__exp_t(&fold_exp_0);
                     }
                     if (v_7) {
                        _fx_free_N10Ast__exp_t(&v_7);
                     }
                     if (v_6) {
                        _fx_free_N10Ast__pat_t(&v_6);
                     }
                     if (for_iter_exp_0) {
                        _fx_free_N10Ast__exp_t(&for_iter_exp_0);
                     }
                     if (for_exp_0) {
                        _fx_free_N10Ast__exp_t(&for_exp_0);
                     }
                     if (ts_3) {
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
                     }
                     _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(&v_5);
                     if (v_4) {
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_4);
                     }
                     FX_FREE_STR(&istr_0);
                     goto _fx_endmatch_10;
                  }
               }
            }
         }
      }
      if (ts_2 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_11 = &ts_2->hd;
         _fx_N14Lexer__token_t* v_12 = &v_11->t0;
         if (v_12->tag == 44) {
            if (v_12->u.LPAREN == false) {
               _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t v_13 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts__0 = 0;
               _fx_LN10Ast__exp_t args_0 = 0;
               _fx_LT2R9Ast__id_tN10Ast__exp_t kw_args_0 = 0;
               _fx_LN10Ast__exp_t args_1 = 0;
               _fx_N10Ast__exp_t v_14 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_15 = {0};
               _fx_N10Ast__exp_t v_16 = 0;
               _fx_LN10Ast__exp_t v_17 = 0;
               _fx_N10Ast__exp_t call_exp_0 = 0;
               _fx_R10Ast__loc_t* l1_0 = &v_11->t1;
               FX_CALL(
                  _fx_M6ParserFM14parse_exp_listT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t5LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
                     ts_2->tl, &_fx_g14Parser__RPAREN, &_fx_g15Parser__KwMaybe, true, false, &v_13, 0), _fx_catch_32);
               FX_COPY_PTR(v_13.t0, &ts__0);
               FX_COPY_PTR(v_13.t2, &args_0);
               FX_COPY_PTR(v_13.t3, &kw_args_0);
               if (kw_args_0 == 0) {
                  FX_COPY_PTR(args_0, &args_1);
               }
               else {
                  FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(l1_0, &v_14), _fx_catch_32);
                  FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(l1_0, &v_15, 0), _fx_catch_32);
                  FX_CALL(
                     _fx_M3AstFM11ExpMkRecordN10Ast__exp_t3N10Ast__exp_tLT2RM4id_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_14,
                        kw_args_0, &v_15, &v_16), _fx_catch_32);
                  FX_CALL(_fx_cons_LN10Ast__exp_t(v_16, 0, true, &v_17), _fx_catch_32);
                  FX_CALL(_fx_M6ParserFM7__add__LN10Ast__exp_t2LN10Ast__exp_tLN10Ast__exp_t(args_0, v_17, &args_1, 0),
                     _fx_catch_32);
               }
               if (FX_REC_VARIANT_TAG(e_2) == 7) {
                  fx_str_t istr_1 = {0};
                  _fx_T2N10Ast__typ_tR10Ast__loc_t v_18 = {0};
                  _fx_T2N10Ast__typ_tR10Ast__loc_t v_19 = {0};
                  FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&e_2->u.ExpIdent.t0, &istr_1, 0), _fx_catch_30);
                  bool v_20;
                  fx_str_t slit_1 = FX_MAKE_STR("__intrin_");
                  v_20 = _fx_M6StringFM10startswithB2SS(&istr_1, &slit_1, 0);
                  if (v_20) {
                     _fx_N13Ast__intrin_t iop_0;
                     fx_str_t slit_2 = FX_MAKE_STR("__intrin_sqrt__");
                     if (fx_streq(&istr_1, &slit_2)) {
                        _fx_R9Ast__id_t v_21;
                        fx_str_t slit_3 = FX_MAKE_STR("sqrt");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_3, &v_21, 0), _fx_catch_3);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_21, &iop_0);

                     _fx_catch_3: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_4 = FX_MAKE_STR("__intrin_pow__");
                     if (fx_streq(&istr_1, &slit_4)) {
                        _fx_R9Ast__id_t v_22;
                        fx_str_t slit_5 = FX_MAKE_STR("pow");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_5, &v_22, 0), _fx_catch_4);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_22, &iop_0);

                     _fx_catch_4: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_6 = FX_MAKE_STR("__intrin_sin__");
                     if (fx_streq(&istr_1, &slit_6)) {
                        _fx_R9Ast__id_t v_23;
                        fx_str_t slit_7 = FX_MAKE_STR("sin");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_7, &v_23, 0), _fx_catch_5);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_23, &iop_0);

                     _fx_catch_5: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_8 = FX_MAKE_STR("__intrin_cos__");
                     if (fx_streq(&istr_1, &slit_8)) {
                        _fx_R9Ast__id_t v_24;
                        fx_str_t slit_9 = FX_MAKE_STR("cos");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_9, &v_24, 0), _fx_catch_6);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_24, &iop_0);

                     _fx_catch_6: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_10 = FX_MAKE_STR("__intrin_tan__");
                     if (fx_streq(&istr_1, &slit_10)) {
                        _fx_R9Ast__id_t v_25;
                        fx_str_t slit_11 = FX_MAKE_STR("tan");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_11, &v_25, 0), _fx_catch_7);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_25, &iop_0);

                     _fx_catch_7: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_12 = FX_MAKE_STR("__intrin_asin__");
                     if (fx_streq(&istr_1, &slit_12)) {
                        _fx_R9Ast__id_t v_26;
                        fx_str_t slit_13 = FX_MAKE_STR("asin");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_13, &v_26, 0), _fx_catch_8);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_26, &iop_0);

                     _fx_catch_8: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_14 = FX_MAKE_STR("__intrin_acos__");
                     if (fx_streq(&istr_1, &slit_14)) {
                        _fx_R9Ast__id_t v_27;
                        fx_str_t slit_15 = FX_MAKE_STR("acos");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_15, &v_27, 0), _fx_catch_9);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_27, &iop_0);

                     _fx_catch_9: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_16 = FX_MAKE_STR("__intrin_atan__");
                     if (fx_streq(&istr_1, &slit_16)) {
                        _fx_R9Ast__id_t v_28;
                        fx_str_t slit_17 = FX_MAKE_STR("atan");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_17, &v_28, 0), _fx_catch_10);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_28, &iop_0);

                     _fx_catch_10: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_18 = FX_MAKE_STR("__intrin_atan2__");
                     if (fx_streq(&istr_1, &slit_18)) {
                        _fx_R9Ast__id_t v_29;
                        fx_str_t slit_19 = FX_MAKE_STR("atan2");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_19, &v_29, 0), _fx_catch_11);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_29, &iop_0);

                     _fx_catch_11: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_20 = FX_MAKE_STR("__intrin_log__");
                     if (fx_streq(&istr_1, &slit_20)) {
                        _fx_R9Ast__id_t v_30;
                        fx_str_t slit_21 = FX_MAKE_STR("log");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_21, &v_30, 0), _fx_catch_12);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_30, &iop_0);

                     _fx_catch_12: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_22 = FX_MAKE_STR("__intrin_exp__");
                     if (fx_streq(&istr_1, &slit_22)) {
                        _fx_R9Ast__id_t v_31;
                        fx_str_t slit_23 = FX_MAKE_STR("exp");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_23, &v_31, 0), _fx_catch_13);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_31, &iop_0);

                     _fx_catch_13: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_24 = FX_MAKE_STR("__intrin_atanh__");
                     if (fx_streq(&istr_1, &slit_24)) {
                        _fx_R9Ast__id_t v_32;
                        fx_str_t slit_25 = FX_MAKE_STR("atanh");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_25, &v_32, 0), _fx_catch_14);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_32, &iop_0);

                     _fx_catch_14: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_26 = FX_MAKE_STR("__intrin_asinh__");
                     if (fx_streq(&istr_1, &slit_26)) {
                        _fx_R9Ast__id_t v_33;
                        fx_str_t slit_27 = FX_MAKE_STR("asinh");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_27, &v_33, 0), _fx_catch_15);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_33, &iop_0);

                     _fx_catch_15: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_28 = FX_MAKE_STR("__intrin_acosh__");
                     if (fx_streq(&istr_1, &slit_28)) {
                        _fx_R9Ast__id_t v_34;
                        fx_str_t slit_29 = FX_MAKE_STR("acosh");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_29, &v_34, 0), _fx_catch_16);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_34, &iop_0);

                     _fx_catch_16: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_30 = FX_MAKE_STR("__intrin_sinh__");
                     if (fx_streq(&istr_1, &slit_30)) {
                        _fx_R9Ast__id_t v_35;
                        fx_str_t slit_31 = FX_MAKE_STR("sinh");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_31, &v_35, 0), _fx_catch_17);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_35, &iop_0);

                     _fx_catch_17: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_32 = FX_MAKE_STR("__intrin_cosh__");
                     if (fx_streq(&istr_1, &slit_32)) {
                        _fx_R9Ast__id_t v_36;
                        fx_str_t slit_33 = FX_MAKE_STR("cosh");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_33, &v_36, 0), _fx_catch_18);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_36, &iop_0);

                     _fx_catch_18: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_34 = FX_MAKE_STR("__intrin_tanh__");
                     if (fx_streq(&istr_1, &slit_34)) {
                        _fx_R9Ast__id_t v_37;
                        fx_str_t slit_35 = FX_MAKE_STR("tanh");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_35, &v_37, 0), _fx_catch_19);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_37, &iop_0);

                     _fx_catch_19: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_36 = FX_MAKE_STR("__intrin_min__");
                     if (fx_streq(&istr_1, &slit_36)) {
                        _fx_R9Ast__id_t v_38;
                        fx_str_t slit_37 = FX_MAKE_STR("min");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_37, &v_38, 0), _fx_catch_20);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_38, &iop_0);

                     _fx_catch_20: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_38 = FX_MAKE_STR("__intrin_max__");
                     if (fx_streq(&istr_1, &slit_38)) {
                        _fx_R9Ast__id_t v_39;
                        fx_str_t slit_39 = FX_MAKE_STR("max");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_39, &v_39, 0), _fx_catch_21);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_39, &iop_0);

                     _fx_catch_21: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_40 = FX_MAKE_STR("__intrin_abs__");
                     if (fx_streq(&istr_1, &slit_40)) {
                        _fx_R9Ast__id_t v_40;
                        fx_str_t slit_41 = FX_MAKE_STR("abs");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_41, &v_40, 0), _fx_catch_22);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_40, &iop_0);

                     _fx_catch_22: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_42 = FX_MAKE_STR("__intrin_floor__");
                     if (fx_streq(&istr_1, &slit_42)) {
                        _fx_R9Ast__id_t v_41;
                        fx_str_t slit_43 = FX_MAKE_STR("floor");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_43, &v_41, 0), _fx_catch_23);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_41, &iop_0);

                     _fx_catch_23: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_44 = FX_MAKE_STR("__intrin_ceil__");
                     if (fx_streq(&istr_1, &slit_44)) {
                        _fx_R9Ast__id_t v_42;
                        fx_str_t slit_45 = FX_MAKE_STR("ceil");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_45, &v_42, 0), _fx_catch_24);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_42, &iop_0);

                     _fx_catch_24: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_46 = FX_MAKE_STR("__intrin_round__");
                     if (fx_streq(&istr_1, &slit_46)) {
                        _fx_R9Ast__id_t v_43;
                        fx_str_t slit_47 = FX_MAKE_STR("round");
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_47, &v_43, 0), _fx_catch_25);
                        _fx_M3AstFM10IntrinMathN13Ast__intrin_t1RM4id_t(&v_43, &iop_0);

                     _fx_catch_25: ;
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_48 = FX_MAKE_STR("__intrin_sat_uint8__");
                     if (fx_streq(&istr_1, &slit_48)) {
                        _fx_M3AstFM14IntrinSaturateN13Ast__intrin_t1N12Ast__sctyp_t(&_fx_g15Parser__ScUInt8, &iop_0);
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_49 = FX_MAKE_STR("__intrin_sat_int8__");
                     if (fx_streq(&istr_1, &slit_49)) {
                        _fx_M3AstFM14IntrinSaturateN13Ast__intrin_t1N12Ast__sctyp_t(&_fx_g14Parser__ScInt8, &iop_0);
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_50 = FX_MAKE_STR("__intrin_sat_uint16__");
                     if (fx_streq(&istr_1, &slit_50)) {
                        _fx_M3AstFM14IntrinSaturateN13Ast__intrin_t1N12Ast__sctyp_t(&_fx_g16Parser__ScUInt16, &iop_0);
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_51 = FX_MAKE_STR("__intrin_sat_int16__");
                     if (fx_streq(&istr_1, &slit_51)) {
                        _fx_M3AstFM14IntrinSaturateN13Ast__intrin_t1N12Ast__sctyp_t(&_fx_g15Parser__ScInt16, &iop_0);
                        goto _fx_endmatch_0;
                     }
                     fx_str_t slit_52 = FX_MAKE_STR("__intrin_size__");
                     if (fx_streq(&istr_1, &slit_52)) {
                        iop_0 = _fx_g21Parser__IntrinGetSize; goto _fx_endmatch_0;
                     }
                     fx_str_t slit_53 = FX_MAKE_STR("__intrin_gemm__");
                     if (fx_streq(&istr_1, &slit_53)) {
                        iop_0 = _fx_g18Parser__IntrinGEMM; goto _fx_endmatch_0;
                     }
                     fx_str_t v_44 = {0};
                     fx_str_t v_45 = {0};
                     fx_exn_t v_46 = {0};
                     FX_CALL(_fx_M6ParserFM6stringS1S(&istr_1, &v_44, 0), _fx_catch_26);
                     fx_str_t slit_54 = FX_MAKE_STR("unknown/unsupported intrinsic \'");
                     fx_str_t slit_55 = FX_MAKE_STR("\'");
                     {
                        const fx_str_t strs_0[] = { slit_54, v_44, slit_55 };
                        FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_45), _fx_catch_26);
                     }
                     FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &v_45, &v_46, 0), _fx_catch_26);
                     FX_THROW(&v_46, true, _fx_catch_26);

                  _fx_catch_26: ;
                     fx_free_exn(&v_46);
                     FX_FREE_STR(&v_45);
                     FX_FREE_STR(&v_44);

                  _fx_endmatch_0: ;
                     FX_CHECK_EXN(_fx_catch_30);
                     FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&eloc_0, &v_18, 0), _fx_catch_30);
                     FX_CALL(
                        _fx_M3AstFM9ExpIntrinN10Ast__exp_t3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&iop_0, args_1,
                           &v_18, &call_exp_0), _fx_catch_30);
                  }
                  else {
                     bool v_47;
                     fx_str_t slit_56 = FX_MAKE_STR("vector");
                     bool t_0;
                     if (_fx_F6__eq__B2SS(&istr_1, &slit_56, 0)) {
                        t_0 = true;
                     }
                     else {
                        fx_str_t slit_57 = FX_MAKE_STR("list"); t_0 = _fx_F6__eq__B2SS(&istr_1, &slit_57, 0);
                     }
                     bool t_1;
                     if (t_0) {
                        t_1 = true;
                     }
                     else {
                        fx_str_t slit_58 = FX_MAKE_STR("array"); t_1 = _fx_F6__eq__B2SS(&istr_1, &slit_58, 0);
                     }
                     if (t_1) {
                        bool res_1;
                        if (args_1 != 0) {
                           if (args_1->tl == 0) {
                              if (FX_REC_VARIANT_TAG(args_1->hd) == 27) {
                                 res_1 = true; goto _fx_endmatch_1;
                              }
                           }
                        }
                        if (args_1 != 0) {
                           if (args_1->tl == 0) {
                              _fx_N10Ast__exp_t v_48 = args_1->hd;
                              if (FX_REC_VARIANT_TAG(v_48) == 14) {
                                 _fx_LLN10Ast__exp_t v_49 = v_48->u.ExpMkArray.t0;
                                 if (v_49 != 0) {
                                    if (v_49->tl == 0) {
                                       res_1 = true; goto _fx_endmatch_1;
                                    }
                                 }
                              }
                           }
                        }
                        if (args_1 != 0) {
                           if (args_1->tl == 0) {
                              if (FX_REC_VARIANT_TAG(args_1->hd) == 15) {
                                 res_1 = true; goto _fx_endmatch_1;
                              }
                           }
                        }
                        res_1 = false;

                     _fx_endmatch_1: ;
                        FX_CHECK_EXN(_fx_catch_30);
                        if (res_1) {
                           v_47 = true; goto _fx_endmatch_2;
                        }
                        v_47 = false;

                     _fx_endmatch_2: ;
                        FX_CHECK_EXN(_fx_catch_30);
                     }
                     else {
                        v_47 = false;
                     }
                     if (v_47) {
                        if (args_1 != 0) {
                           if (args_1->tl == 0) {
                              _fx_N10Ast__exp_t v_50 = args_1->hd;
                              if (FX_REC_VARIANT_TAG(v_50) == 27) {
                                 _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t*
                                    vcase_0 = &v_50->u.ExpMap;
                                 _fx_R16Ast__for_flags_t* flags_0 = &vcase_0->t2;
                                 bool v_51;
                                 fx_str_t slit_59 = FX_MAKE_STR("array");
                                 v_51 = _fx_F6__eq__B2SS(&istr_1, &slit_59, 0);
                                 _fx_N15Ast__for_make_t mkflag_0;
                                 if (v_51) {
                                    mkflag_0 = _fx_g20Parser__ForMakeArray;
                                 }
                                 else {
                                    bool v_52;
                                    fx_str_t slit_60 = FX_MAKE_STR("vector");
                                    v_52 = _fx_F6__eq__B2SS(&istr_1, &slit_60, 0);
                                    if (v_52) {
                                       mkflag_0 = _fx_g21Parser__ForMakeVector;
                                    }
                                    else {
                                       mkflag_0 = _fx_g19Parser__ForMakeList;
                                    }
                                 }
                                 _fx_R16Ast__for_flags_t v_53 =
                                    { flags_0->for_flag_parallel, mkflag_0, flags_0->for_flag_unzip, flags_0->for_flag_fold,
                                       flags_0->for_flag_nested };
                                 FX_CALL(
                                    _fx_M3AstFM6ExpMapN10Ast__exp_t4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tRM11for_flags_tT2N10Ast__typ_tRM5loc_t(
                                       vcase_0->t0, vcase_0->t1, &v_53, &vcase_0->t3, &call_exp_0), _fx_catch_27);

                              _fx_catch_27: ;
                                 goto _fx_endmatch_4;
                              }
                           }
                        }
                        _fx_N10Ast__exp_t v_54 = 0;
                        _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t v_55 = {0};
                        _fx_LN10Ast__exp_t el_0 = 0;
                        _fx_T2N10Ast__typ_tR10Ast__loc_t ctx_0 = {0};
                        _fx_LLN10Ast__exp_t v_56 = 0;
                        FX_CALL(_fx_M6ParserFM2hdN10Ast__exp_t1LN10Ast__exp_t(args_1, &v_54, 0), _fx_catch_29);
                        int tag_0 = FX_REC_VARIANT_TAG(v_54);
                        if (tag_0 == 14) {
                           _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_1 = &v_54->u.ExpMkArray;
                           _fx_LLN10Ast__exp_t v_57 = vcase_1->t0;
                           if (v_57 != 0) {
                              if (v_57->tl == 0) {
                                 _fx_make_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(v_57->hd, &vcase_1->t1, &v_55);
                                 goto _fx_endmatch_3;
                              }
                           }
                        }
                        if (tag_0 == 15) {
                           _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* vcase_2 = &v_54->u.ExpMkVector;
                           _fx_make_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(vcase_2->t0, &vcase_2->t1, &v_55);
                           goto _fx_endmatch_3;
                        }
                        fx_str_t v_58 = {0};
                        fx_str_t v_59 = {0};
                        fx_exn_t v_60 = {0};
                        FX_CALL(_fx_M6ParserFM6stringS1S(&istr_1, &v_58, 0), _fx_catch_28);
                        fx_str_t slit_61 = FX_MAKE_STR("unexpected \'");
                        fx_str_t slit_62 = FX_MAKE_STR("\' argument");
                        {
                           const fx_str_t strs_1[] = { slit_61, v_58, slit_62 };
                           FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_59), _fx_catch_28);
                        }
                        FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &v_59, &v_60, 0),
                           _fx_catch_28);
                        FX_THROW(&v_60, true, _fx_catch_28);

                     _fx_catch_28: ;
                        fx_free_exn(&v_60);
                        FX_FREE_STR(&v_59);
                        FX_FREE_STR(&v_58);

                     _fx_endmatch_3: ;
                        FX_CHECK_EXN(_fx_catch_29);
                        FX_COPY_PTR(v_55.t0, &el_0);
                        _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&v_55.t1, &ctx_0);
                        bool v_61;
                        fx_str_t slit_63 = FX_MAKE_STR("array");
                        v_61 = _fx_F6__eq__B2SS(&istr_1, &slit_63, 0);
                        if (v_61) {
                           FX_CALL(_fx_cons_LLN10Ast__exp_t(el_0, 0, true, &v_56), _fx_catch_29);
                           FX_CALL(
                              _fx_M3AstFM10ExpMkArrayN10Ast__exp_t2LLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_56, &ctx_0,
                                 &call_exp_0), _fx_catch_29);
                        }
                        else {
                           bool v_62;
                           fx_str_t slit_64 = FX_MAKE_STR("vector");
                           v_62 = _fx_F6__eq__B2SS(&istr_1, &slit_64, 0);
                           if (v_62) {
                              FX_CALL(
                                 _fx_M3AstFM11ExpMkVectorN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(el_0, &ctx_0,
                                    &call_exp_0), _fx_catch_29);
                           }
                           else {
                              _fx_R10Ast__loc_t v_63 = ctx_0.t1;
                              FX_CALL(
                                 _fx_M6ParserFM13make_list_expN10Ast__exp_t2LN10Ast__exp_tR10Ast__loc_t(el_0, &v_63,
                                    &call_exp_0, 0), _fx_catch_29);
                           }
                        }

                     _fx_catch_29: ;
                        if (v_56) {
                           _fx_free_LLN10Ast__exp_t(&v_56);
                        }
                        _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&ctx_0);
                        if (el_0) {
                           _fx_free_LN10Ast__exp_t(&el_0);
                        }
                        _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&v_55);
                        if (v_54) {
                           _fx_free_N10Ast__exp_t(&v_54);
                        }

                     _fx_endmatch_4: ;
                        FX_CHECK_EXN(_fx_catch_30);
                     }
                     else {
                        FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&eloc_0, &v_19, 0), _fx_catch_30);
                        FX_CALL(
                           _fx_M3AstFM7ExpCallN10Ast__exp_t3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(e_2, args_1,
                              &v_19, &call_exp_0), _fx_catch_30);
                     }
                  }

               _fx_catch_30: ;
                  _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_19);
                  _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_18);
                  FX_FREE_STR(&istr_1);
               }
               else {
                  _fx_T2N10Ast__typ_tR10Ast__loc_t v_64 = {0};
                  FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&eloc_0, &v_64, 0), _fx_catch_31);
                  FX_CALL(
                     _fx_M3AstFM7ExpCallN10Ast__exp_t3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(e_2, args_1, &v_64,
                        &call_exp_0), _fx_catch_31);

               _fx_catch_31: ;
                  _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_64);
               }
               FX_CHECK_EXN(_fx_catch_32);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(ts__0, &ts_1);
               _fx_free_N10Ast__exp_t(&e_1);
               FX_COPY_PTR(call_exp_0, &e_1);

            _fx_catch_32: ;
               if (call_exp_0) {
                  _fx_free_N10Ast__exp_t(&call_exp_0);
               }
               if (v_17) {
                  _fx_free_LN10Ast__exp_t(&v_17);
               }
               if (v_16) {
                  _fx_free_N10Ast__exp_t(&v_16);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_15);
               if (v_14) {
                  _fx_free_N10Ast__exp_t(&v_14);
               }
               if (args_1) {
                  _fx_free_LN10Ast__exp_t(&args_1);
               }
               if (kw_args_0) {
                  _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&kw_args_0);
               }
               if (args_0) {
                  _fx_free_LN10Ast__exp_t(&args_0);
               }
               if (ts__0) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts__0);
               }
               _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&v_13);
               goto _fx_endmatch_10;
            }
         }
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_65 = &ts_2->hd.t0;
         if (v_65->tag == 47) {
            if (v_65->u.LSQUARE == false) {
               _fx_FPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t __lambda___0 = {0};
               _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t v_66 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
               _fx_LN10Ast__exp_t idxs_0 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_67 = {0};
               _fx_N10Ast__exp_t at_exp_0 = 0;
               _fx_FPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t __lambda___fp_0 =
                  {
                     _fx_M6ParserFM10__lambda__T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t,
                     0 };
               FX_COPY_FP(&__lambda___fp_0, &__lambda___0);
               FX_CALL(
                  _fx_M6ParserFM16parse_exp_list_fT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t6LT2N14Lexer__token_tR10Ast__loc_tFPT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
                     ts_2->tl, &__lambda___0, &_fx_g15Parser__RSQUARE, &_fx_g14Parser__KwNone, false, false, &v_66, 0),
                  _fx_catch_33);
               FX_COPY_PTR(v_66.t0, &ts_5);
               FX_COPY_PTR(v_66.t2, &idxs_0);
               FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&eloc_0, &v_67, 0), _fx_catch_33);
               FX_CALL(
                  _fx_M3AstFM5ExpAtN10Ast__exp_t5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                     e_2, &_fx_g18Parser__BorderNone, &_fx_g18Parser__InterpNone, idxs_0, &v_67, &at_exp_0), _fx_catch_33);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(ts_5, &ts_1);
               _fx_free_N10Ast__exp_t(&e_1);
               FX_COPY_PTR(at_exp_0, &e_1);

            _fx_catch_33: ;
               if (at_exp_0) {
                  _fx_free_N10Ast__exp_t(&at_exp_0);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_67);
               if (idxs_0) {
                  _fx_free_LN10Ast__exp_t(&idxs_0);
               }
               if (ts_5) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
               }
               _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&v_66);
               FX_FREE_FP(&__lambda___0);
               goto _fx_endmatch_10;
            }
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 49) {
            if (allow_mkrecord_0) {
               _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t v_68 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
               _fx_LT2R9Ast__id_tN10Ast__exp_t rec_init_elems_0 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_69 = {0};
               _fx_N10Ast__exp_t mkrecord_exp_0 = 0;
               FX_CALL(
                  _fx_M6ParserFM14parse_exp_listT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t5LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
                     ts_2->tl, &_fx_g14Parser__RBRACE, &_fx_g14Parser__KwMust, true, false, &v_68, 0), _fx_catch_34);
               FX_COPY_PTR(v_68.t0, &ts_6);
               FX_COPY_PTR(v_68.t3, &rec_init_elems_0);
               _fx_R10Ast__loc_t v_70;
               FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_2, &v_70, 0), _fx_catch_34);
               FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_70, &v_69, 0), _fx_catch_34);
               FX_CALL(
                  _fx_M3AstFM11ExpMkRecordN10Ast__exp_t3N10Ast__exp_tLT2RM4id_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(e_2,
                     rec_init_elems_0, &v_69, &mkrecord_exp_0), _fx_catch_34);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(ts_6, &ts_1);
               _fx_free_N10Ast__exp_t(&e_1);
               FX_COPY_PTR(mkrecord_exp_0, &e_1);

            _fx_catch_34: ;
               if (mkrecord_exp_0) {
                  _fx_free_N10Ast__exp_t(&mkrecord_exp_0);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_69);
               if (rec_init_elems_0) {
                  _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&rec_init_elems_0);
               }
               if (ts_6) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
               }
               _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&v_68);
               goto _fx_endmatch_10;
            }
         }
      }
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_71 = ts_2->tl;
         if (v_71 != 0) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_72 = &v_71->hd;
            _fx_R10Ast__loc_t* l2_0 = &v_72->t1;
            _fx_N14Lexer__token_t* t2_0 = &v_72->t0;
            _fx_N14Lexer__token_t* t1_0 = &ts_2->hd.t0;
            int tag_1 = t1_0->tag;
            bool res_2;
            bool res_3;
            if (tag_1 == 52) {
               res_3 = true;
            }
            else if (tag_1 == 61) {
               res_3 = true;
            }
            else {
               res_3 = false;
            }
            FX_CHECK_EXN(_fx_catch_43);
            if (res_3) {
               res_2 = true; goto _fx_endmatch_5;
            }
            res_2 = false;

         _fx_endmatch_5: ;
            FX_CHECK_EXN(_fx_catch_43);
            bool t_2;
            if (res_2) {
               int tag_2 = t2_0->tag;
               bool res_4;
               if (tag_2 == 2) {
                  if (t2_0->u.IDENT.t0 == true) {
                     res_4 = true; goto _fx_endmatch_6;
                  }
               }
               if (tag_2 == 1) {
                  if (t2_0->u.LITERAL.tag == 1) {
                     res_4 = true; goto _fx_endmatch_6;
                  }
               }
               res_4 = false;

            _fx_endmatch_6: ;
               FX_CHECK_EXN(_fx_catch_43);
               if (res_4) {
                  t_2 = true; goto _fx_endmatch_7;
               }
               t_2 = false;

            _fx_endmatch_7: ;
               FX_CHECK_EXN(_fx_catch_43);
            }
            else {
               t_2 = false;
            }
            if (t_2) {
               _fx_N10Ast__exp_t e_3 = 0;
               _fx_N10Ast__exp_t i_0 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_73 = {0};
               _fx_N10Ast__exp_t v_74 = 0;
               if (t1_0->tag == 61) {
                  FX_CALL(
                     _fx_M6ParserFM10make_unaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tR10Ast__loc_t(&_fx_g15Parser__OpDeref,
                        e_2, &eloc_0, &e_3, 0), _fx_catch_35);

               _fx_catch_35: ;
               }
               else {
                  FX_COPY_PTR(e_2, &e_3);
               }
               FX_CHECK_EXN(_fx_catch_39);
               int tag_3 = t2_0->tag;
               if (tag_3 == 2) {
                  _fx_T2BS* vcase_3 = &t2_0->u.IDENT;
                  if (vcase_3->t0 == true) {
                     FX_CALL(_fx_M6ParserFM10make_identN10Ast__exp_t2SR10Ast__loc_t(&vcase_3->t1, l2_0, &i_0, 0), _fx_catch_36);

                  _fx_catch_36: ;
                     goto _fx_endmatch_8;
                  }
               }
               if (tag_3 == 1) {
                  _fx_N10Ast__lit_t* v_75 = &t2_0->u.LITERAL;
                  if (v_75->tag == 1) {
                     _fx_N10Ast__lit_t v_76 = {0};
                     _fx_M3AstFM6LitIntN10Ast__lit_t1l(v_75->u.LitInt, &v_76);
                     FX_CALL(_fx_M6ParserFM12make_literalN10Ast__exp_t2N10Ast__lit_tR10Ast__loc_t(&v_76, l2_0, &i_0, 0),
                        _fx_catch_37);

                  _fx_catch_37: ;
                     _fx_free_N10Ast__lit_t(&v_76);
                     goto _fx_endmatch_8;
                  }
               }
               FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(l2_0, &i_0), _fx_catch_38);

            _fx_catch_38: ;

            _fx_endmatch_8: ;
               FX_CHECK_EXN(_fx_catch_39);
               FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&eloc_0, &v_73, 0), _fx_catch_39);
               FX_CALL(
                  _fx_M3AstFM6ExpMemN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(e_3, i_0, &v_73, &v_74),
                  _fx_catch_39);
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &v_71->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               _fx_free_N10Ast__exp_t(&e_1);
               FX_COPY_PTR(v_74, &e_1);

            _fx_catch_39: ;
               if (v_74) {
                  _fx_free_N10Ast__exp_t(&v_74);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_73);
               if (i_0) {
                  _fx_free_N10Ast__exp_t(&i_0);
               }
               if (e_3) {
                  _fx_free_N10Ast__exp_t(&e_3);
               }
               goto _fx_endmatch_10;
            }
         }
      }
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_77 = ts_2->tl;
         if (v_77 != 0) {
            if (v_77->hd.t0.tag == 49) {
               _fx_N14Lexer__token_t* t1_1 = &ts_2->hd.t0;
               int tag_4 = t1_1->tag;
               bool res_5;
               bool res_6;
               if (tag_4 == 52) {
                  res_6 = true;
               }
               else if (tag_4 == 61) {
                  res_6 = true;
               }
               else {
                  res_6 = false;
               }
               FX_CHECK_EXN(_fx_catch_43);
               if (res_6) {
                  res_5 = true; goto _fx_endmatch_9;
               }
               res_5 = false;

            _fx_endmatch_9: ;
               FX_CHECK_EXN(_fx_catch_43);
               if (res_5) {
                  _fx_N10Ast__exp_t e_4 = 0;
                  _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t v_78 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_7 = 0;
                  _fx_LT2R9Ast__id_tN10Ast__exp_t rec_init_elems_1 = 0;
                  _fx_T2N10Ast__typ_tR10Ast__loc_t v_79 = {0};
                  _fx_N10Ast__exp_t v_80 = 0;
                  if (t1_1->tag == 61) {
                     FX_CALL(
                        _fx_M6ParserFM10make_unaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tR10Ast__loc_t(
                           &_fx_g15Parser__OpDeref, e_2, &eloc_0, &e_4, 0), _fx_catch_40);

                  _fx_catch_40: ;
                  }
                  else {
                     FX_COPY_PTR(e_2, &e_4);
                  }
                  FX_CHECK_EXN(_fx_catch_41);
                  FX_CALL(
                     _fx_M6ParserFM14parse_exp_listT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t5LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
                        v_77->tl, &_fx_g14Parser__RBRACE, &_fx_g14Parser__KwMust, true, false, &v_78, 0), _fx_catch_41);
                  FX_COPY_PTR(v_78.t0, &ts_7);
                  FX_COPY_PTR(v_78.t3, &rec_init_elems_1);
                  FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&eloc_0, &v_79, 0), _fx_catch_41);
                  FX_CALL(
                     _fx_M3AstFM15ExpUpdateRecordN10Ast__exp_t3N10Ast__exp_tLT2RM4id_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(e_4,
                        rec_init_elems_1, &v_79, &v_80), _fx_catch_41);
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  FX_COPY_PTR(ts_7, &ts_1);
                  _fx_free_N10Ast__exp_t(&e_1);
                  FX_COPY_PTR(v_80, &e_1);

               _fx_catch_41: ;
                  if (v_80) {
                     _fx_free_N10Ast__exp_t(&v_80);
                  }
                  _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_79);
                  if (rec_init_elems_1) {
                     _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&rec_init_elems_1);
                  }
                  if (ts_7) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_7);
                  }
                  _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&v_78);
                  if (e_4) {
                     _fx_free_N10Ast__exp_t(&e_4);
                  }
                  goto _fx_endmatch_10;
               }
            }
         }
      }
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_1 = {0};
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, e_2, &result_1);
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_0);
      _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1, &result_0);
      FX_BREAK(_fx_catch_42);

   _fx_catch_42: ;
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1);

   _fx_endmatch_10: ;
      FX_CHECK_EXN(_fx_catch_43);

   _fx_catch_43: ;
      if (e_2) {
         _fx_free_N10Ast__exp_t(&e_2);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (e_1) {
      _fx_free_N10Ast__exp_t(&e_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM15parse_deref_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_0 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_1 = &v_0->t0;
      if (v_1->tag == 66) {
         if (v_1->u.STAR == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_2 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
            _fx_N10Ast__exp_t e_0 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_3 = {0};
            _fx_N10Ast__exp_t v_4 = 0;
            FX_CALL(
               _fx_M6ParserFM15parse_deref_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_0->tl, allow_mkrecord_0, &v_2, 0), _fx_catch_0);
            FX_COPY_PTR(v_2.t0, &ts_1);
            FX_COPY_PTR(v_2.t1, &e_0);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_0->t1, &v_3, 0), _fx_catch_0);
            FX_CALL(
               _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g15Parser__OpDeref,
                  e_0, &v_3, &v_4), _fx_catch_0);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1, v_4, fx_result);

         _fx_catch_0: ;
            if (v_4) {
               _fx_free_N10Ast__exp_t(&v_4);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_3);
            if (e_0) {
               _fx_free_N10Ast__exp_t(&e_0);
            }
            if (ts_1) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_2);
            goto _fx_endmatch_0;
         }
      }
   }
   FX_CALL(
      _fx_M6ParserFM16parse_simple_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0,
         allow_mkrecord_0, fx_result, 0), _fx_catch_1);

_fx_catch_1: ;

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM14parse_apos_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t e_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM15parse_deref_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0,
         allow_mkrecord_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &e_0);
   if (ts_1 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_1 = &ts_1->hd;
      if (v_1->t0.tag == 4) {
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_2 = {0};
         _fx_N10Ast__exp_t v_3 = 0;
         FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_1->t1, &v_2, 0), _fx_catch_0);
         FX_CALL(
            _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g14Parser__OpApos, e_0,
               &v_2, &v_3), _fx_catch_0);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1->tl, v_3, fx_result);

      _fx_catch_0: ;
         if (v_3) {
            _fx_free_N10Ast__exp_t(&v_3);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_2);
         goto _fx_endmatch_0;
      }
   }
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1, e_0, fx_result);

_fx_endmatch_0: ;

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (e_0) {
      _fx_free_N10Ast__exp_t(&e_0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_0 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_1 = &v_0->t0;
      if (v_1->tag == 33) {
         if (v_1->u.REF == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_2 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
            _fx_N10Ast__exp_t e_0 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_3 = {0};
            _fx_N10Ast__exp_t v_4 = 0;
            FX_CALL(
               _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_0->tl, allow_mkrecord_0, &v_2, 0), _fx_catch_0);
            FX_COPY_PTR(v_2.t0, &ts_1);
            FX_COPY_PTR(v_2.t1, &e_0);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_0->t1, &v_3, 0), _fx_catch_0);
            FX_CALL(
               _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g15Parser__OpMkRef,
                  e_0, &v_3, &v_4), _fx_catch_0);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1, v_4, fx_result);

         _fx_catch_0: ;
            if (v_4) {
               _fx_free_N10Ast__exp_t(&v_4);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_3);
            if (e_0) {
               _fx_free_N10Ast__exp_t(&e_0);
            }
            if (ts_1) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_2);
            goto _fx_endmatch_0;
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_5 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_6 = &v_5->t0;
      if (v_6->tag == 64) {
         if (v_6->u.MINUS == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_7 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
            _fx_N10Ast__exp_t e_1 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_8 = {0};
            _fx_N10Ast__exp_t v_9 = 0;
            FX_CALL(
               _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_0->tl, allow_mkrecord_0, &v_7, 0), _fx_catch_1);
            FX_COPY_PTR(v_7.t0, &ts_2);
            FX_COPY_PTR(v_7.t1, &e_1);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_5->t1, &v_8, 0), _fx_catch_1);
            FX_CALL(
               _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g16Parser__OpNegate,
                  e_1, &v_8, &v_9), _fx_catch_1);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, v_9, fx_result);

         _fx_catch_1: ;
            if (v_9) {
               _fx_free_N10Ast__exp_t(&v_9);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_8);
            if (e_1) {
               _fx_free_N10Ast__exp_t(&e_1);
            }
            if (ts_2) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_7);
            goto _fx_endmatch_0;
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_10 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_11 = &v_10->t0;
      if (v_11->tag == 73) {
         if (v_11->u.DOT_MINUS == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_12 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
            _fx_N10Ast__exp_t e_2 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_13 = {0};
            _fx_N10Ast__exp_t v_14 = 0;
            FX_CALL(
               _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_0->tl, allow_mkrecord_0, &v_12, 0), _fx_catch_2);
            FX_COPY_PTR(v_12.t0, &ts_3);
            FX_COPY_PTR(v_12.t1, &e_2);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_10->t1, &v_13, 0), _fx_catch_2);
            FX_CALL(
               _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g18Parser__OpDotMinus,
                  e_2, &v_13, &v_14), _fx_catch_2);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_3, v_14, fx_result);

         _fx_catch_2: ;
            if (v_14) {
               _fx_free_N10Ast__exp_t(&v_14);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_13);
            if (e_2) {
               _fx_free_N10Ast__exp_t(&e_2);
            }
            if (ts_3) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_12);
            goto _fx_endmatch_0;
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_15 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_16 = &v_15->t0;
      if (v_16->tag == 65) {
         if (v_16->u.PLUS == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_17 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
            _fx_N10Ast__exp_t e_3 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_18 = {0};
            _fx_N10Ast__exp_t v_19 = 0;
            FX_CALL(
               _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_0->tl, allow_mkrecord_0, &v_17, 0), _fx_catch_3);
            FX_COPY_PTR(v_17.t0, &ts_4);
            FX_COPY_PTR(v_17.t1, &e_3);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_15->t1, &v_18, 0), _fx_catch_3);
            FX_CALL(
               _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g14Parser__OpPlus,
                  e_3, &v_18, &v_19), _fx_catch_3);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_4, v_19, fx_result);

         _fx_catch_3: ;
            if (v_19) {
               _fx_free_N10Ast__exp_t(&v_19);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_18);
            if (e_3) {
               _fx_free_N10Ast__exp_t(&e_3);
            }
            if (ts_4) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_17);
            goto _fx_endmatch_0;
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_20 = &ts_0->hd;
      if (v_20->t0.tag == 82) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_21 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
         _fx_N10Ast__exp_t e_4 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_22 = {0};
         _fx_N10Ast__exp_t v_23 = 0;
         FX_CALL(
            _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
               ts_0->tl, allow_mkrecord_0, &v_21, 0), _fx_catch_4);
         FX_COPY_PTR(v_21.t0, &ts_5);
         FX_COPY_PTR(v_21.t1, &e_4);
         FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_20->t1, &v_22, 0), _fx_catch_4);
         FX_CALL(
            _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g20Parser__OpBitwiseNot,
               e_4, &v_22, &v_23), _fx_catch_4);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_5, v_23, fx_result);

      _fx_catch_4: ;
         if (v_23) {
            _fx_free_N10Ast__exp_t(&v_23);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_22);
         if (e_4) {
            _fx_free_N10Ast__exp_t(&e_4);
         }
         if (ts_5) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_21);
         goto _fx_endmatch_0;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_24 = &ts_0->hd;
      if (v_24->t0.tag == 85) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_25 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
         _fx_N10Ast__exp_t e_5 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_26 = {0};
         _fx_N10Ast__exp_t v_27 = 0;
         FX_CALL(
            _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
               ts_0->tl, allow_mkrecord_0, &v_25, 0), _fx_catch_5);
         FX_COPY_PTR(v_25.t0, &ts_6);
         FX_COPY_PTR(v_25.t1, &e_5);
         FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_24->t1, &v_26, 0), _fx_catch_5);
         FX_CALL(
            _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g18Parser__OpLogicNot,
               e_5, &v_26, &v_27), _fx_catch_5);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_6, v_27, fx_result);

      _fx_catch_5: ;
         if (v_27) {
            _fx_free_N10Ast__exp_t(&v_27);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_26);
         if (e_5) {
            _fx_free_N10Ast__exp_t(&e_5);
         }
         if (ts_6) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_25);
         goto _fx_endmatch_0;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_28 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_29 = &v_28->t0;
      if (v_29->tag == 58) {
         if (v_29->u.BACKSLASH == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_30 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_7 = 0;
            _fx_N10Ast__exp_t e_6 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_31 = {0};
            _fx_N10Ast__exp_t v_32 = 0;
            FX_CALL(
               _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_0->tl, allow_mkrecord_0, &v_30, 0), _fx_catch_6);
            FX_COPY_PTR(v_30.t0, &ts_7);
            FX_COPY_PTR(v_30.t1, &e_6);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_28->t1, &v_31, 0), _fx_catch_6);
            FX_CALL(
               _fx_M3AstFM8ExpUnaryN10Ast__exp_t3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(&_fx_g16Parser__OpExpand,
                  e_6, &v_31, &v_32), _fx_catch_6);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_7, v_32, fx_result);

         _fx_catch_6: ;
            if (v_32) {
               _fx_free_N10Ast__exp_t(&v_32);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_31);
            if (e_6) {
               _fx_free_N10Ast__exp_t(&e_6);
            }
            if (ts_7) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_7);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_30);
            goto _fx_endmatch_0;
         }
      }
   }
   FX_CALL(
      _fx_M6ParserFM14parse_apos_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0,
         allow_mkrecord_0, fx_result, 0), _fx_catch_7);

_fx_catch_7: ;

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM16parse_binary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t e_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0,
         allow_mkrecord_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &e_0);
   FX_CALL(
      _fx_M6ParserFM17parse_binary_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tiB(
         ts_1, e_0, 0, allow_mkrecord_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (e_0) {
      _fx_free_N10Ast__exp_t(&e_0);
   }
   return fx_status;
}

static int
   _fx_M6ParserFM17parse_binary_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tiB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N10Ast__exp_t_data_t* result_0,
   int_ min_prec_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(result_0, &result_2);
   int_ min_prec_1 = min_prec_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_N10Ast__exp_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(result_2, &result_3);
      int_ min_prec_2 = min_prec_1;
      if (ts_2 != 0) {
         _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t v_0 = {0};
         _fx_N13Ast__binary_t bop_0 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_4 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_1 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N10Ast__exp_t e_0 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_2 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_N10Ast__exp_t rhs_0 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_3 = {0};
         _fx_N10Ast__exp_t result_5 = 0;
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_4 = &ts_2->hd;
         _fx_N14Lexer__token_t* t_0 = &v_4->t0;
         int tag_0 = t_0->tag;
         if (tag_0 == 65) {
            if (t_0->u.PLUS == false) {
               _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpAdd, 210, &_fx_g17Parser__AssocLeft, &v_0);
               goto _fx_endmatch_0;
            }
         }
         if (tag_0 == 64) {
            if (t_0->u.MINUS == false) {
               _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpSub, 210, &_fx_g17Parser__AssocLeft, &v_0);
               goto _fx_endmatch_0;
            }
         }
         if (tag_0 == 66) {
            if (t_0->u.STAR == false) {
               _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpMul, 220, &_fx_g17Parser__AssocLeft, &v_0);
               goto _fx_endmatch_0;
            }
         }
         if (tag_0 == 67) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpDiv, 220, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 58) {
            if (t_0->u.BACKSLASH == false) {
               _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g14Parser__OpRDiv, 220, &_fx_g17Parser__AssocLeft, &v_0);
               goto _fx_endmatch_0;
            }
         }
         if (tag_0 == 69) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpMod, 220, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 56) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g14Parser__OpCons, 100, &_fx_g18Parser__AssocRight, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 70) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpPow, 230, &_fx_g18Parser__AssocRight, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 78) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g19Parser__OpShiftLeft, 200, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 77) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g20Parser__OpShiftRight, 200, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 81) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g19Parser__OpBitwiseOr, 130, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 79) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g20Parser__OpBitwiseAnd, 150, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 80) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g20Parser__OpBitwiseXor, 140, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 89) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g19Parser__OpSpaceship, 170, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 72) {
            if (t_0->u.DOT_PLUS == false) {
               _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g16Parser__OpDotAdd, 210, &_fx_g17Parser__AssocLeft, &v_0);
               goto _fx_endmatch_0;
            }
         }
         if (tag_0 == 73) {
            if (t_0->u.DOT_MINUS == false) {
               _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g16Parser__OpDotSub, 210, &_fx_g17Parser__AssocLeft, &v_0);
               goto _fx_endmatch_0;
            }
         }
         if (tag_0 == 71) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g16Parser__OpDotMul, 220, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 74) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g16Parser__OpDotDiv, 220, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 75) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g16Parser__OpDotMod, 220, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 71) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g16Parser__OpDotMul, 220, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 76) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g16Parser__OpDotPow, 230, &_fx_g18Parser__AssocRight, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 92) {
            _fx_N13Ast__binary_t v_5 = 0;
            FX_CALL(_fx_M3AstFM8OpDotCmpN13Ast__binary_t1N12Ast__cmpop_t(&t_0->u.DOT_CMP, &v_5), _fx_catch_0);
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(v_5, 180, &_fx_g17Parser__AssocLeft, &v_0);

         _fx_catch_0: ;
            if (v_5) {
               _fx_free_N13Ast__binary_t(&v_5);
            }
            goto _fx_endmatch_0;
         }
         if (tag_0 == 91) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g22Parser__OpDotSpaceship, 190, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 93) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g14Parser__OpSame, 190, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpAdd, -1, &_fx_g17Parser__AssocLeft, &v_0);

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_1);
         FX_COPY_PTR(v_0.t0, &bop_0);
         int_ prec_0 = v_0.t1;
         _fx_N15Ast__op_assoc_t assoc_0 = v_0.t2;
         if (prec_0 < min_prec_2) {
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, result_3, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_4, &result_1);
            FX_BREAK(_fx_catch_1);
         }
         else {
            int_ next_min_prec_0;
            if (assoc_0.tag == 1) {
               next_min_prec_0 = prec_0 + 1;
            }
            else {
               next_min_prec_0 = prec_0;
            }
            FX_CHECK_EXN(_fx_catch_1);
            FX_CALL(
               _fx_M6ParserFM15parse_unary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_2->tl, allow_mkrecord_0, &v_1, 0), _fx_catch_1);
            FX_COPY_PTR(v_1.t0, &ts_3);
            FX_COPY_PTR(v_1.t1, &e_0);
            FX_CALL(
               _fx_M6ParserFM17parse_binary_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tiB(
                  ts_3, e_0, next_min_prec_0, allow_mkrecord_0, &v_2, 0), _fx_catch_1);
            FX_COPY_PTR(v_2.t0, &ts_4);
            FX_COPY_PTR(v_2.t1, &rhs_0);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_4->t1, &v_3, 0), _fx_catch_1);
            FX_CALL(
               _fx_M3AstFM9ExpBinaryN10Ast__exp_t4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(bop_0,
                  result_3, rhs_0, &v_3, &result_5), _fx_catch_1);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_4, &ts_1);
            _fx_free_N10Ast__exp_t(&result_2);
            FX_COPY_PTR(result_5, &result_2);
            min_prec_1 = min_prec_2;
         }

      _fx_catch_1: ;
         if (result_5) {
            _fx_free_N10Ast__exp_t(&result_5);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_3);
         if (rhs_0) {
            _fx_free_N10Ast__exp_t(&rhs_0);
         }
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_2);
         if (e_0) {
            _fx_free_N10Ast__exp_t(&e_0);
         }
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_1);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_4);
         if (bop_0) {
            _fx_free_N13Ast__binary_t(&bop_0);
         }
         _fx_free_T3N13Ast__binary_tiN15Ast__op_assoc_t(&v_0);
      }
      else {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_6 = {0};
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, result_3, &result_6);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_6, &result_1);
         FX_BREAK(_fx_catch_2);

      _fx_catch_2: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_6);
      }
      FX_CHECK_EXN(_fx_catch_3);

   _fx_catch_3: ;
      if (result_3) {
         _fx_free_N10Ast__exp_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_N10Ast__exp_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t e_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM18parse_chained_cmp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
         ts_0, allow_mkrecord_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &e_0);
   FX_CALL(
      _fx_M6ParserFM16parse_logic_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tiB(
         ts_1, e_0, 0, allow_mkrecord_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (e_0) {
      _fx_free_N10Ast__exp_t(&e_0);
   }
   return fx_status;
}

static int
   _fx_M6ParserFM19extend_chained_cmp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tLT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t_data_t* chain_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t chain_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(chain_0, &chain_1);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t chain_2 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(chain_1, &chain_2);
      if (ts_2 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_0 = &ts_2->hd;
         _fx_N14Lexer__token_t* v_1 = &v_0->t0;
         if (v_1->tag == 90) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_2 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
            _fx_N10Ast__exp_t e_0 = 0;
            _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t v_3 = {0};
            _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t v_4 = 0;
            FX_CALL(
               _fx_M6ParserFM16parse_binary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_2->tl, allow_mkrecord_0, &v_2, 0), _fx_catch_0);
            FX_COPY_PTR(v_2.t0, &ts_3);
            FX_COPY_PTR(v_2.t1, &e_0);
            _fx_T2N12Ast__cmpop_tR10Ast__loc_t v_5 = { v_1->u.CMP, v_0->t1 };
            _fx_make_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_5, e_0, &v_3);
            FX_CALL(_fx_cons_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_3, chain_2, true, &v_4), _fx_catch_0);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_3, &ts_1);
            _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&chain_1);
            FX_COPY_PTR(v_4, &chain_1);

         _fx_catch_0: ;
            if (v_4) {
               _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_4);
            }
            _fx_free_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_3);
            if (e_0) {
               _fx_free_N10Ast__exp_t(&e_0);
            }
            if (ts_3) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_2);
            goto _fx_endmatch_3;
         }
      }
      _fx_N10Ast__exp_t result_1 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_2 = {0};
      if (chain_2 != 0) {
         if (chain_2->tl == 0) {
            FX_COPY_PTR(chain_2->hd.t1, &result_1); goto _fx_endmatch_2;
         }
      }
      if (chain_2 != 0) {
         _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t v_6 = chain_2->tl;
         if (v_6 != 0) {
            if (v_6->tl == 0) {
               _fx_N13Ast__binary_t v_7 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_8 = {0};
               _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t* v_9 = &chain_2->hd;
               _fx_T2N12Ast__cmpop_tR10Ast__loc_t* v_10 = &v_9->t0;
               FX_CALL(_fx_M3AstFM5OpCmpN13Ast__binary_t1N12Ast__cmpop_t(&v_10->t0, &v_7), _fx_catch_1);
               _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypBool, &v_10->t1, &v_8);
               FX_CALL(
                  _fx_M3AstFM9ExpBinaryN10Ast__exp_t4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_7,
                     v_6->hd.t1, v_9->t1, &v_8, &result_1), _fx_catch_1);

            _fx_catch_1: ;
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_8);
               if (v_7) {
                  _fx_free_N13Ast__binary_t(&v_7);
               }
               goto _fx_endmatch_2;
            }
         }
      }
      _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t __fold_result___0 = 0;
      _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t chain_3 = 0;
      _fx_N10Ast__exp_t v_11 = 0;
      _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t v_12 = {0};
      _fx_N10Ast__exp_t v_13 = 0;
      _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t __fold_result___1 = {0};
      _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t v_14 = 0;
      _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t v_15 = {0};
      _fx_N10Ast__exp_t result_3 = 0;
      _fx_LN10Ast__exp_t code_0 = 0;
      _fx_LN10Ast__exp_t __fold_result___2 = 0;
      _fx_LN10Ast__exp_t v_16 = 0;
      _fx_LN10Ast__exp_t v_17 = 0;
      _fx_LN10Ast__exp_t v_18 = 0;
      _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t lst_0 = chain_2;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t r_0 = 0;
         _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t* a_0 = &lst_0->hd;
         FX_COPY_PTR(__fold_result___0, &r_0);
         FX_CALL(_fx_cons_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_2);
         _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&__fold_result___0);
         FX_COPY_PTR(r_0, &__fold_result___0);

      _fx_catch_2: ;
         if (r_0) {
            _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&r_0);
         }
         FX_CHECK_EXN(_fx_catch_11);
      }
      FX_COPY_PTR(__fold_result___0, &chain_3);
      int_ nexp_0 = _fx_M6ParserFM6lengthi1LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(chain_3, 0);
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&_fx_g10Ast__noloc, &v_11), _fx_catch_11);
      if (chain_3 != 0) {
         _fx_copy_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&chain_3->hd, &v_12);
      }
      else {
         FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_11);
      }
      FX_CHECK_EXN(_fx_catch_11);
      FX_COPY_PTR(v_12.t1, &v_13);
      _fx_make_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(v_11, v_13, 0, &__fold_result___1);
      if (chain_3 != 0) {
         FX_COPY_PTR(chain_3->tl, &v_14);
      }
      else {
         FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_11);
      }
      FX_CHECK_EXN(_fx_catch_11);
      int_ i_0 = 0;
      _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t lst_1 = v_14;
      for (; lst_1; lst_1 = lst_1->tl, i_0 += 1) {
         _fx_N10Ast__exp_t e_1 = 0;
         _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t v_19 = {0};
         _fx_N10Ast__exp_t result_4 = 0;
         _fx_N10Ast__exp_t prev_e_0 = 0;
         _fx_LN10Ast__exp_t code_1 = 0;
         _fx_T2N10Ast__exp_tLN10Ast__exp_t v_20 = {0};
         _fx_N10Ast__exp_t next_e_0 = 0;
         _fx_LN10Ast__exp_t code_2 = 0;
         _fx_N13Ast__binary_t v_21 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_22 = {0};
         _fx_N10Ast__exp_t cmp_exp_0 = 0;
         _fx_N10Ast__exp_t result_5 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_23 = {0};
         _fx_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t v_24 = {0};
         _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t* __pat___0 = &lst_1->hd;
         _fx_T2N12Ast__cmpop_tR10Ast__loc_t* i_1 = &__pat___0->t0;
         _fx_N12Ast__cmpop_t cmpop_0 = i_1->t0;
         _fx_R10Ast__loc_t loc_0 = i_1->t1;
         FX_COPY_PTR(__pat___0->t1, &e_1);
         _fx_copy_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(&__fold_result___1, &v_19);
         FX_COPY_PTR(v_19.t0, &result_4);
         FX_COPY_PTR(v_19.t1, &prev_e_0);
         FX_COPY_PTR(v_19.t2, &code_1);
         if (i_0 == nexp_0 - 2) {
            _fx_make_T2N10Ast__exp_tLN10Ast__exp_t(e_1, code_1, &v_20);
         }
         else {
            int tag_0 = FX_REC_VARIANT_TAG(e_1);
            bool res_0;
            if (tag_0 == 6) {
               res_0 = true;
            }
            else if (tag_0 == 7) {
               res_0 = true;
            }
            else {
               res_0 = false;
            }
            FX_CHECK_EXN(_fx_catch_4);
            if (res_0) {
               _fx_make_T2N10Ast__exp_tLN10Ast__exp_t(e_1, code_1, &v_20); goto _fx_endmatch_0;
            }
            _fx_N10Ast__pat_t v_25 = 0;
            _fx_R16Ast__val_flags_t v_26 = {0};
            _fx_N10Ast__exp_t tmp_decl_0 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_27 = {0};
            _fx_N10Ast__exp_t v_28 = 0;
            _fx_LN10Ast__exp_t v_29 = 0;
            _fx_R10Ast__loc_t e_loc_0;
            FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_1, &e_loc_0, 0), _fx_catch_3);
            _fx_R9Ast__id_t tmp_id_0;
            fx_str_t slit_0 = FX_MAKE_STR("t");
            FX_CALL(_fx_M3AstFM6gen_idRM4id_t2iS(_fx_g18Parser__parser_ctx.m_idx, &slit_0, &tmp_id_0, 0), _fx_catch_3);
            FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&tmp_id_0, &e_loc_0, &v_25), _fx_catch_3);
            FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_26, 0), _fx_catch_3);
            FX_CALL(
               _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(v_25, e_1, &v_26, &e_loc_0,
                  &tmp_decl_0), _fx_catch_3);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&e_loc_0, &v_27, 0), _fx_catch_3);
            FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&tmp_id_0, &v_27, &v_28), _fx_catch_3);
            FX_CALL(_fx_cons_LN10Ast__exp_t(tmp_decl_0, code_1, true, &v_29), _fx_catch_3);
            _fx_make_T2N10Ast__exp_tLN10Ast__exp_t(v_28, v_29, &v_20);

         _fx_catch_3: ;
            if (v_29) {
               _fx_free_LN10Ast__exp_t(&v_29);
            }
            if (v_28) {
               _fx_free_N10Ast__exp_t(&v_28);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_27);
            if (tmp_decl_0) {
               _fx_free_N10Ast__exp_t(&tmp_decl_0);
            }
            _fx_free_R16Ast__val_flags_t(&v_26);
            if (v_25) {
               _fx_free_N10Ast__pat_t(&v_25);
            }

         _fx_endmatch_0: ;
            FX_CHECK_EXN(_fx_catch_4);
         }
         FX_COPY_PTR(v_20.t0, &next_e_0);
         FX_COPY_PTR(v_20.t1, &code_2);
         FX_CALL(_fx_M3AstFM5OpCmpN13Ast__binary_t1N12Ast__cmpop_t(&cmpop_0, &v_21), _fx_catch_4);
         _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypBool, &loc_0, &v_22);
         FX_CALL(
            _fx_M3AstFM9ExpBinaryN10Ast__exp_t4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_21, prev_e_0,
               next_e_0, &v_22, &cmp_exp_0), _fx_catch_4);
         if (i_0 == 0) {
            FX_COPY_PTR(cmp_exp_0, &result_5);
         }
         else {
            _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypBool, &loc_0, &v_23);
            FX_CALL(
               _fx_M3AstFM9ExpBinaryN10Ast__exp_t4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                  _fx_g20Parser__OpBitwiseAnd, result_4, cmp_exp_0, &v_23, &result_5), _fx_catch_4);
         }
         _fx_make_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(result_5, next_e_0, code_2, &v_24);
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(&__fold_result___1);
         _fx_copy_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(&v_24, &__fold_result___1);

      _fx_catch_4: ;
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(&v_24);
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_23);
         if (result_5) {
            _fx_free_N10Ast__exp_t(&result_5);
         }
         if (cmp_exp_0) {
            _fx_free_N10Ast__exp_t(&cmp_exp_0);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_22);
         if (v_21) {
            _fx_free_N13Ast__binary_t(&v_21);
         }
         if (code_2) {
            _fx_free_LN10Ast__exp_t(&code_2);
         }
         if (next_e_0) {
            _fx_free_N10Ast__exp_t(&next_e_0);
         }
         _fx_free_T2N10Ast__exp_tLN10Ast__exp_t(&v_20);
         if (code_1) {
            _fx_free_LN10Ast__exp_t(&code_1);
         }
         if (prev_e_0) {
            _fx_free_N10Ast__exp_t(&prev_e_0);
         }
         if (result_4) {
            _fx_free_N10Ast__exp_t(&result_4);
         }
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(&v_19);
         if (e_1) {
            _fx_free_N10Ast__exp_t(&e_1);
         }
         FX_CHECK_EXN(_fx_catch_11);
      }
      _fx_copy_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(&__fold_result___1, &v_15);
      FX_COPY_PTR(v_15.t0, &result_3);
      FX_COPY_PTR(v_15.t2, &code_0);
      _fx_LN10Ast__exp_t lst_2 = code_0;
      for (; lst_2; lst_2 = lst_2->tl) {
         _fx_LN10Ast__exp_t r_1 = 0;
         _fx_N10Ast__exp_t a_1 = lst_2->hd;
         FX_COPY_PTR(__fold_result___2, &r_1);
         FX_CALL(_fx_cons_LN10Ast__exp_t(a_1, r_1, false, &r_1), _fx_catch_5);
         _fx_free_LN10Ast__exp_t(&__fold_result___2);
         FX_COPY_PTR(r_1, &__fold_result___2);

      _fx_catch_5: ;
         if (r_1) {
            _fx_free_LN10Ast__exp_t(&r_1);
         }
         FX_CHECK_EXN(_fx_catch_11);
      }
      FX_COPY_PTR(__fold_result___2, &v_16);
      FX_CALL(_fx_cons_LN10Ast__exp_t(result_3, 0, true, &v_17), _fx_catch_11);
      if (v_16 == 0) {
         FX_COPY_PTR(v_17, &v_18);
      }
      else if (v_17 == 0) {
         FX_COPY_PTR(v_16, &v_18);
      }
      else {
         _fx_LN10Ast__exp_t v_30 = 0;
         _fx_LN10Ast__exp_t lstend_0 = 0;
         _fx_LN10Ast__exp_t lst_3 = v_16;
         for (; lst_3; lst_3 = lst_3->tl) {
            _fx_N10Ast__exp_t x_0 = lst_3->hd;
            _fx_LN10Ast__exp_t node_0 = 0;
            FX_CALL(_fx_cons_LN10Ast__exp_t(x_0, 0, false, &node_0), _fx_catch_6);
            FX_LIST_APPEND(v_30, lstend_0, node_0);

         _fx_catch_6: ;
            FX_CHECK_EXN(_fx_catch_7);
         }
         _fx_M6ParserFM5link2LN10Ast__exp_t2LN10Ast__exp_tLN10Ast__exp_t(v_30, v_17, &v_18, 0);

      _fx_catch_7: ;
         if (v_30) {
            _fx_free_LN10Ast__exp_t(&v_30);
         }
      }
      FX_CHECK_EXN(_fx_catch_11);
      _fx_R10Ast__loc_t v_31;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(result_3, &v_31, 0), _fx_catch_11);
      if (v_18 == 0) {
         FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&v_31, &result_1), _fx_catch_8);  _fx_catch_8: ; goto _fx_endmatch_1;
      }
      if (v_18 != 0) {
         if (v_18->tl == 0) {
            FX_COPY_PTR(v_18->hd, &result_1); goto _fx_endmatch_1;
         }
      }
      _fx_LR10Ast__loc_t llist_0 = 0;
      _fx_N10Ast__typ_t v_32 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_33 = {0};
      _fx_LR10Ast__loc_t lstend_1 = 0;
      _fx_LN10Ast__exp_t lst_4 = v_18;
      for (; lst_4; lst_4 = lst_4->tl) {
         _fx_N10Ast__exp_t e_2 = lst_4->hd;
         _fx_R10Ast__loc_t res_1;
         FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_2, &res_1, 0), _fx_catch_9);
         _fx_LR10Ast__loc_t node_1 = 0;
         FX_CALL(_fx_cons_LR10Ast__loc_t(&res_1, 0, false, &node_1), _fx_catch_9);
         FX_LIST_APPEND(llist_0, lstend_1, node_1);

      _fx_catch_9: ;
         FX_CHECK_EXN(_fx_catch_10);
      }
      _fx_R10Ast__loc_t loc_1;
      FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(llist_0, &v_31, &loc_1, 0), _fx_catch_10);
      FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_32, 0), _fx_catch_10);
      _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_32, &loc_1, &v_33);
      FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_18, &v_33, &result_1), _fx_catch_10);

   _fx_catch_10: ;
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_33);
      if (v_32) {
         _fx_free_N10Ast__typ_t(&v_32);
      }
      FX_FREE_LIST_SIMPLE(&llist_0);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_11);

   _fx_catch_11: ;
      if (v_18) {
         _fx_free_LN10Ast__exp_t(&v_18);
      }
      if (v_17) {
         _fx_free_LN10Ast__exp_t(&v_17);
      }
      if (v_16) {
         _fx_free_LN10Ast__exp_t(&v_16);
      }
      if (__fold_result___2) {
         _fx_free_LN10Ast__exp_t(&__fold_result___2);
      }
      if (code_0) {
         _fx_free_LN10Ast__exp_t(&code_0);
      }
      if (result_3) {
         _fx_free_N10Ast__exp_t(&result_3);
      }
      _fx_free_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(&v_15);
      if (v_14) {
         _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_14);
      }
      _fx_free_T3N10Ast__exp_tN10Ast__exp_tLN10Ast__exp_t(&__fold_result___1);
      if (v_13) {
         _fx_free_N10Ast__exp_t(&v_13);
      }
      _fx_free_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_12);
      if (v_11) {
         _fx_free_N10Ast__exp_t(&v_11);
      }
      if (chain_3) {
         _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&chain_3);
      }
      if (__fold_result___0) {
         _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&__fold_result___0);
      }

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_12);
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, result_1, &result_2);
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_0);
      _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_2, &result_0);
      FX_BREAK(_fx_catch_12);

   _fx_catch_12: ;
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_2);
      if (result_1) {
         _fx_free_N10Ast__exp_t(&result_1);
      }

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_13);

   _fx_catch_13: ;
      if (chain_2) {
         _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&chain_2);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (chain_1) {
      _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&chain_1);
   }
   return fx_status;
}

static int
   _fx_M6ParserFM18parse_chained_cmp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t e_0 = 0;
   _fx_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t v_1 = {0};
   _fx_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t v_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM16parse_binary_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0,
         allow_mkrecord_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &e_0);
   _fx_T2N12Ast__cmpop_tR10Ast__loc_t v_3 = { _fx_g13Parser__CmpEQ, _fx_g10Ast__noloc };
   _fx_make_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_3, e_0, &v_1);
   FX_CALL(_fx_cons_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_1, 0, true, &v_2), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM19extend_chained_cmp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tLT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_tB(
         ts_1, v_2, allow_mkrecord_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (e_0) {
      _fx_free_N10Ast__exp_t(&e_0);
   }
   _fx_free_T2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_1);
   if (v_2) {
      _fx_free_LT2T2N12Ast__cmpop_tR10Ast__loc_tN10Ast__exp_t(&v_2);
   }
   return fx_status;
}

static int
   _fx_M6ParserFM16parse_logic_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tiB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N10Ast__exp_t_data_t* result_0,
   int_ min_prec_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(result_0, &result_2);
   int_ min_prec_1 = min_prec_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_N10Ast__exp_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(result_2, &result_3);
      int_ min_prec_2 = min_prec_1;
      if (ts_2 != 0) {
         _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t v_0 = {0};
         _fx_N13Ast__binary_t bop_0 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_4 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_1 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N10Ast__exp_t e_0 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_2 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_N10Ast__exp_t rhs_0 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_3 = {0};
         _fx_N10Ast__exp_t result_5 = 0;
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_4 = &ts_2->hd;
         int tag_0 = v_4->t0.tag;
         if (tag_0 == 84) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g17Parser__OpLogicOr, 10, &_fx_g17Parser__AssocLeft, &v_0);
         }
         else if (tag_0 == 83) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g18Parser__OpLogicAnd, 20, &_fx_g17Parser__AssocLeft, &v_0);
         }
         else {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpAdd, -1, &_fx_g17Parser__AssocLeft, &v_0);
         }
         FX_CHECK_EXN(_fx_catch_0);
         FX_COPY_PTR(v_0.t0, &bop_0);
         int_ prec_0 = v_0.t1;
         _fx_N15Ast__op_assoc_t assoc_0 = v_0.t2;
         if (prec_0 < min_prec_2) {
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, result_3, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_4, &result_1);
            FX_BREAK(_fx_catch_0);
         }
         else {
            int_ next_min_prec_0;
            if (assoc_0.tag == 1) {
               next_min_prec_0 = prec_0 + 1;
            }
            else {
               next_min_prec_0 = prec_0;
            }
            FX_CHECK_EXN(_fx_catch_0);
            FX_CALL(
               _fx_M6ParserFM18parse_chained_cmp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_2->tl, allow_mkrecord_0, &v_1, 0), _fx_catch_0);
            FX_COPY_PTR(v_1.t0, &ts_3);
            FX_COPY_PTR(v_1.t1, &e_0);
            FX_CALL(
               _fx_M6ParserFM16parse_logic_exp_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tiB(
                  ts_3, e_0, next_min_prec_0, allow_mkrecord_0, &v_2, 0), _fx_catch_0);
            FX_COPY_PTR(v_2.t0, &ts_4);
            FX_COPY_PTR(v_2.t1, &rhs_0);
            _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypBool, &v_4->t1, &v_3);
            FX_CALL(
               _fx_M3AstFM9ExpBinaryN10Ast__exp_t4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(bop_0,
                  result_3, rhs_0, &v_3, &result_5), _fx_catch_0);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_4, &ts_1);
            _fx_free_N10Ast__exp_t(&result_2);
            FX_COPY_PTR(result_5, &result_2);
            min_prec_1 = min_prec_2;
         }

      _fx_catch_0: ;
         if (result_5) {
            _fx_free_N10Ast__exp_t(&result_5);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_3);
         if (rhs_0) {
            _fx_free_N10Ast__exp_t(&rhs_0);
         }
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_2);
         if (e_0) {
            _fx_free_N10Ast__exp_t(&e_0);
         }
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_1);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_4);
         if (bop_0) {
            _fx_free_N13Ast__binary_t(&bop_0);
         }
         _fx_free_T3N13Ast__binary_tiN15Ast__op_assoc_t(&v_0);
      }
      else {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t result_6 = {0};
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, result_3, &result_6);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_6, &result_1);
         FX_BREAK(_fx_catch_1);

      _fx_catch_1: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_6);
      }
      FX_CHECK_EXN(_fx_catch_2);

   _fx_catch_2: ;
      if (result_3) {
         _fx_free_N10Ast__exp_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_N10Ast__exp_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM18parse_exp_or_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 49) {
         FX_CALL(
            _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
               fx_result, 0), _fx_catch_0);

      _fx_catch_0: ;
         goto _fx_endmatch_0;
      }
   }
   FX_CALL(
      _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0, true,
         fx_result, 0), _fx_catch_1);

_fx_catch_1: ;

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM26parse_complex_exp_or_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 49) {
         FX_CALL(
            _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
               fx_result, 0), _fx_catch_0);

      _fx_catch_0: ;
         goto _fx_endmatch_0;
      }
   }
   FX_CALL(
      _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
         fx_result, 0), _fx_catch_1);

_fx_catch_1: ;

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 68) {
         FX_CALL(
            _fx_M6ParserFM10parse_syncT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_0->tl, fx_result, 0), _fx_catch_0);

      _fx_catch_0: ;
         goto _fx_endmatch_2;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_0 = &ts_0->hd;
      if (v_0->t0.tag == 49) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t v_1 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
         _fx_LN10Ast__exp_t eseq_0 = 0;
         _fx_N10Ast__exp_t e_0 = 0;
         _fx_R10Ast__loc_t* l1_0 = &v_0->t1;
         FX_CALL(
            _fx_M6ParserFM12parse_expseqT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
               ts_0->tl, false, &v_1, 0), _fx_catch_5);
         FX_COPY_PTR(v_1.t0, &ts_1);
         FX_COPY_PTR(v_1.t1, &eseq_0);
         if (eseq_0 == 0) {
            FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(l1_0, &e_0), _fx_catch_1);  _fx_catch_1: ; goto _fx_endmatch_0;
         }
         if (eseq_0 != 0) {
            if (eseq_0->tl == 0) {
               FX_COPY_PTR(eseq_0->hd, &e_0); goto _fx_endmatch_0;
            }
         }
         _fx_LR10Ast__loc_t llist_0 = 0;
         _fx_N10Ast__typ_t v_2 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_3 = {0};
         _fx_LR10Ast__loc_t lstend_0 = 0;
         _fx_LN10Ast__exp_t lst_0 = eseq_0;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_N10Ast__exp_t e_1 = lst_0->hd;
            _fx_R10Ast__loc_t res_0;
            FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_1, &res_0, 0), _fx_catch_2);
            _fx_LR10Ast__loc_t node_0 = 0;
            FX_CALL(_fx_cons_LR10Ast__loc_t(&res_0, 0, false, &node_0), _fx_catch_2);
            FX_LIST_APPEND(llist_0, lstend_0, node_0);

         _fx_catch_2: ;
            FX_CHECK_EXN(_fx_catch_3);
         }
         _fx_R10Ast__loc_t loc_0;
         FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(llist_0, l1_0, &loc_0, 0), _fx_catch_3);
         FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_2, 0), _fx_catch_3);
         _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_2, &loc_0, &v_3);
         FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(eseq_0, &v_3, &e_0), _fx_catch_3);

      _fx_catch_3: ;
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_3);
         if (v_2) {
            _fx_free_N10Ast__typ_t(&v_2);
         }
         FX_FREE_LIST_SIMPLE(&llist_0);

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_5);
         if (ts_1 != 0) {
            bool res_1;
            FX_CALL(
               _fx_M6ParserFM15__eq_variants__B2N14Lexer__token_tN14Lexer__token_t(&ts_1->hd.t0, &_fx_g14Parser__RBRACE, &res_1,
                  0), _fx_catch_5);
            if (res_1) {
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1->tl, e_0, fx_result); goto _fx_endmatch_1;
            }
         }
         _fx_Ta2S v_4 = {0};
         fx_str_t v_5 = {0};
         fx_str_t v_6 = {0};
         fx_str_t v_7 = {0};
         fx_exn_t v_8 = {0};
         FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(&_fx_g14Parser__RBRACE, &v_4, 0), _fx_catch_4);
         fx_copy_str(&v_4.t1, &v_5);
         FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(l1_0, &v_6, 0), _fx_catch_4);
         fx_str_t slit_0 = FX_MAKE_STR("\'");
         fx_str_t slit_1 = FX_MAKE_STR("\' is expected; the opening paren is here ");
         {
            const fx_str_t strs_0[] = { slit_0, v_5, slit_1, v_6 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_0, 4, &v_7), _fx_catch_4);
         }
         _fx_R10Ast__loc_t loc_1;
         if (ts_1 != 0) {
            loc_1 = ts_1->hd.t1;
         }
         else {
            loc_1 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_4);
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &v_7, &v_8), _fx_catch_4);
         FX_THROW(&v_8, true, _fx_catch_4);

      _fx_catch_4: ;
         fx_free_exn(&v_8);
         FX_FREE_STR(&v_7);
         FX_FREE_STR(&v_6);
         FX_FREE_STR(&v_5);
         _fx_free_Ta2S(&v_4);

      _fx_endmatch_1: ;
         FX_CHECK_EXN(_fx_catch_5);

      _fx_catch_5: ;
         if (e_0) {
            _fx_free_N10Ast__exp_t(&e_0);
         }
         if (eseq_0) {
            _fx_free_LN10Ast__exp_t(&eseq_0);
         }
         if (ts_1) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&v_1);
         goto _fx_endmatch_2;
      }
   }
   fx_exn_t v_9 = {0};
   _fx_R10Ast__loc_t loc_2;
   if (ts_0 != 0) {
      loc_2 = ts_0->hd.t1;
   }
   else {
      loc_2 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_6);
   fx_str_t slit_2 = FX_MAKE_STR("\'{\' is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_9), _fx_catch_6);
   FX_THROW(&v_9, true, _fx_catch_6);

_fx_catch_6: ;
   fx_free_exn(&v_9);

_fx_endmatch_2: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10parse_syncT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 2) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS v_1 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
         fx_str_t n_0 = {0};
         fx_str_t slit_0 = FX_MAKE_STR("");
         FX_CALL(
            _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(ts_0, false,
               &slit_0, &v_1, 0), _fx_catch_0);
         FX_COPY_PTR(v_1.t0, &ts_2);
         fx_copy_str(&v_1.t1, &n_0);
         _fx_R9Ast__id_t v_2;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&n_0, &v_2, 0), _fx_catch_0);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(ts_2, &v_2, &v_0);

      _fx_catch_0: ;
         FX_FREE_STR(&n_0);
         if (ts_2) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&v_1);
         goto _fx_endmatch_0;
      }
   }
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(ts_0, &_fx_g9Ast__noid, &v_0);

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   _fx_R9Ast__id_t n_1 = v_0.t1;
   if (ts_1 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_3 = &ts_1->hd;
      if (v_3->t0.tag == 49) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t v_4 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_LN10Ast__exp_t eseq_0 = 0;
         _fx_N10Ast__exp_t v_5 = 0;
         _fx_N10Ast__exp_t e_0 = 0;
         _fx_R10Ast__loc_t* l1_0 = &v_3->t1;
         FX_CALL(
            _fx_M6ParserFM12parse_expseqT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
               ts_1->tl, false, &v_4, 0), _fx_catch_5);
         FX_COPY_PTR(v_4.t0, &ts_3);
         FX_COPY_PTR(v_4.t1, &eseq_0);
         if (eseq_0 == 0) {
            FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(l1_0, &v_5), _fx_catch_1);  _fx_catch_1: ; goto _fx_endmatch_1;
         }
         if (eseq_0 != 0) {
            if (eseq_0->tl == 0) {
               FX_COPY_PTR(eseq_0->hd, &v_5); goto _fx_endmatch_1;
            }
         }
         _fx_LR10Ast__loc_t llist_0 = 0;
         _fx_N10Ast__typ_t v_6 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_7 = {0};
         _fx_LR10Ast__loc_t lstend_0 = 0;
         _fx_LN10Ast__exp_t lst_0 = eseq_0;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_N10Ast__exp_t e_1 = lst_0->hd;
            _fx_R10Ast__loc_t res_0;
            FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_1, &res_0, 0), _fx_catch_2);
            _fx_LR10Ast__loc_t node_0 = 0;
            FX_CALL(_fx_cons_LR10Ast__loc_t(&res_0, 0, false, &node_0), _fx_catch_2);
            FX_LIST_APPEND(llist_0, lstend_0, node_0);

         _fx_catch_2: ;
            FX_CHECK_EXN(_fx_catch_3);
         }
         _fx_R10Ast__loc_t loc_0;
         FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(llist_0, l1_0, &loc_0, 0), _fx_catch_3);
         FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_6, 0), _fx_catch_3);
         _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_6, &loc_0, &v_7);
         FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(eseq_0, &v_7, &v_5), _fx_catch_3);

      _fx_catch_3: ;
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_7);
         if (v_6) {
            _fx_free_N10Ast__typ_t(&v_6);
         }
         FX_FREE_LIST_SIMPLE(&llist_0);

      _fx_endmatch_1: ;
         FX_CHECK_EXN(_fx_catch_5);
         FX_CALL(_fx_M3AstFM7ExpSyncN10Ast__exp_t2RM4id_tN10Ast__exp_t(&n_1, v_5, &e_0), _fx_catch_5);
         if (ts_3 != 0) {
            bool res_1;
            FX_CALL(
               _fx_M6ParserFM15__eq_variants__B2N14Lexer__token_tN14Lexer__token_t(&ts_3->hd.t0, &_fx_g14Parser__RBRACE, &res_1,
                  0), _fx_catch_5);
            if (res_1) {
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_3->tl, e_0, fx_result); goto _fx_endmatch_2;
            }
         }
         _fx_Ta2S v_8 = {0};
         fx_str_t v_9 = {0};
         fx_str_t v_10 = {0};
         fx_str_t v_11 = {0};
         fx_exn_t v_12 = {0};
         FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(&_fx_g14Parser__RBRACE, &v_8, 0), _fx_catch_4);
         fx_copy_str(&v_8.t1, &v_9);
         FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(l1_0, &v_10, 0), _fx_catch_4);
         fx_str_t slit_1 = FX_MAKE_STR("\'");
         fx_str_t slit_2 = FX_MAKE_STR("\' is expected; the opening paren is here ");
         {
            const fx_str_t strs_0[] = { slit_1, v_9, slit_2, v_10 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_0, 4, &v_11), _fx_catch_4);
         }
         _fx_R10Ast__loc_t loc_1;
         if (ts_3 != 0) {
            loc_1 = ts_3->hd.t1;
         }
         else {
            loc_1 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_4);
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &v_11, &v_12), _fx_catch_4);
         FX_THROW(&v_12, true, _fx_catch_4);

      _fx_catch_4: ;
         fx_free_exn(&v_12);
         FX_FREE_STR(&v_11);
         FX_FREE_STR(&v_10);
         FX_FREE_STR(&v_9);
         _fx_free_Ta2S(&v_8);

      _fx_endmatch_2: ;
         FX_CHECK_EXN(_fx_catch_5);

      _fx_catch_5: ;
         if (e_0) {
            _fx_free_N10Ast__exp_t(&e_0);
         }
         if (v_5) {
            _fx_free_N10Ast__exp_t(&v_5);
         }
         if (eseq_0) {
            _fx_free_LN10Ast__exp_t(&eseq_0);
         }
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&v_4);
         goto _fx_endmatch_3;
      }
   }
   fx_exn_t v_13 = {0};
   _fx_R10Ast__loc_t loc_2;
   if (ts_1 != 0) {
      loc_2 = ts_1->hd.t1;
   }
   else {
      loc_2 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_6);
   fx_str_t slit_3 = FX_MAKE_STR("\'{\' is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_3, &v_13), _fx_catch_6);
   FX_THROW(&v_13, true, _fx_catch_6);

_fx_catch_6: ;
   fx_free_exn(&v_13);

_fx_endmatch_3: ;

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM15parse_ccode_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N10Ast__typ_t_data_t* t_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_0 = ts_0->tl;
      if (v_0 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_1 = &v_0->hd;
         _fx_N14Lexer__token_t* v_2 = &v_1->t0;
         if (v_2->tag == 1) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_3 = &ts_0->hd;
            if (v_3->t0.tag == 9) {
               fx_str_t s_0 = {0};
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_4 = {0};
               _fx_N10Ast__exp_t v_5 = 0;
               _fx_N10Ast__lit_t* lit_0 = &v_2->u.LITERAL;
               if (lit_0->tag == 5) {
                  fx_copy_str(&lit_0->u.LitString, &s_0);
               }
               else {
                  fx_exn_t v_6 = {0};
                  fx_str_t slit_0 = FX_MAKE_STR("string literal is expected");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&v_1->t1, &slit_0, &v_6), _fx_catch_0);
                  FX_THROW(&v_6, true, _fx_catch_0);

               _fx_catch_0: ;
                  fx_free_exn(&v_6);
               }
               FX_CHECK_EXN(_fx_catch_1);
               _fx_make_T2N10Ast__typ_tR10Ast__loc_t(t_0, &v_3->t1, &v_4);
               FX_CALL(_fx_M3AstFM8ExpCCodeN10Ast__exp_t2ST2N10Ast__typ_tRM5loc_t(&s_0, &v_4, &v_5), _fx_catch_1);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(v_0->tl, v_5, fx_result);

            _fx_catch_1: ;
               if (v_5) {
                  _fx_free_N10Ast__exp_t(&v_5);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_4);
               FX_FREE_STR(&s_0);
               goto _fx_endmatch_0;
            }
         }
      }
   }
   fx_exn_t v_7 = {0};
   _fx_R10Ast__loc_t loc_0;
   if (ts_0 != 0) {
      loc_0 = ts_0->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_2);
   fx_str_t slit_1 = FX_MAKE_STR("\'ccode {...}\' is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_1, &v_7), _fx_catch_2);
   FX_THROW(&v_7, true, _fx_catch_2);

_fx_catch_2: ;
   fx_free_exn(&v_7);

_fx_endmatch_0: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM15parse_range_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts0_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_0 = 0;
   _fx_LNt6option1N10Ast__exp_t elist_0 = 0;
   _fx_T2N10Ast__typ_tR10Ast__loc_t ctx_0 = {0};
   _fx_N10Ast__exp_t e_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_R10Ast__loc_t loc_0;
   if (ts0_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t v_1 = {0};
      if (ts0_0 != 0) {
         _fx_copy_T2N14Lexer__token_tR10Ast__loc_t(&ts0_0->hd, &v_1);
      }
      else {
         FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_0);
      }
      FX_CHECK_EXN(_fx_catch_0);
      loc_0 = v_1.t1;

   _fx_catch_0: ;
      _fx_free_T2N14Lexer__token_tR10Ast__loc_t(&v_1);
   }
   else {
      loc_0 = _fx_g10Ast__noloc;
   }
   FX_CHECK_EXN(_fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM12parse_range_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLNt6option1N10Ast__exp_tB(
         ts0_0, false, 0, allow_mkrecord_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_0);
   FX_COPY_PTR(v_0.t1, &elist_0);
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&loc_0, &ctx_0, 0), _fx_cleanup);
   if (elist_0 != 0) {
      if (elist_0->tl == 0) {
         _fx_Nt6option1N10Ast__exp_t v_2 = elist_0->hd;
         if ((v_2 != 0) + 1 == 2) {
            FX_COPY_PTR(v_2->u.Some, &e_0); goto _fx_endmatch_1;
         }
      }
   }
   if (elist_0 != 0) {
      if ((elist_0->hd != 0) + 1 == 1) {
         _fx_LNt6option1N10Ast__exp_t v_3 = elist_0->tl;
         if (v_3 != 0) {
            if (v_3->tl == 0) {
               if ((v_3->hd != 0) + 1 == 1) {
                  FX_CALL(
                     _fx_M3AstFM8ExpRangeN10Ast__exp_t4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                        _fx_g14Parser__None2_, _fx_g14Parser__None2_, _fx_g14Parser__None2_, &ctx_0, &e_0), _fx_catch_1);

               _fx_catch_1: ;
                  goto _fx_endmatch_1;
               }
            }
         }
      }
   }
   if (elist_0 == 0) {
      fx_exn_t v_4 = {0};
      _fx_R10Ast__loc_t loc_1;
      if (ts0_0 != 0) {
         loc_1 = ts0_0->hd.t1;
      }
      else {
         loc_1 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_2);
      fx_str_t slit_0 = FX_MAKE_STR("empty range expression");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_0, &v_4), _fx_catch_2);
      FX_THROW(&v_4, true, _fx_catch_2);

   _fx_catch_2: ;
      fx_free_exn(&v_4);
      goto _fx_endmatch_1;
   }
   bool res_0;
   if (elist_0 != 0) {
      if (elist_0->tl == 0) {
         if ((elist_0->hd != 0) + 1 == 1) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
   }
   if (elist_0 != 0) {
      if ((elist_0->hd != 0) + 1 == 1) {
         _fx_LNt6option1N10Ast__exp_t v_5 = elist_0->tl;
         if (v_5 != 0) {
            if ((v_5->hd != 0) + 1 == 1) {
               _fx_LNt6option1N10Ast__exp_t v_6 = v_5->tl;
               if (v_6 != 0) {
                  if (v_6->tl == 0) {
                     if ((v_6->hd != 0) + 1 == 1) {
                        res_0 = true; goto _fx_endmatch_0;
                     }
                  }
               }
            }
         }
      }
   }
   res_0 = false;

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      fx_exn_t v_7 = {0};
      _fx_R10Ast__loc_t loc_2;
      if (ts0_0 != 0) {
         loc_2 = ts0_0->hd.t1;
      }
      else {
         loc_2 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_3);
      fx_str_t slit_1 = FX_MAKE_STR("invalid range expression");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_1, &v_7), _fx_catch_3);
      FX_THROW(&v_7, true, _fx_catch_3);

   _fx_catch_3: ;
      fx_free_exn(&v_7);
      goto _fx_endmatch_1;
   }
   if (elist_0 != 0) {
      _fx_LNt6option1N10Ast__exp_t v_8 = elist_0->tl;
      if (v_8 != 0) {
         if (v_8->tl == 0) {
            if ((v_8->hd != 0) + 1 == 1) {
               FX_CALL(
                  _fx_M3AstFM8ExpRangeN10Ast__exp_t4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                     elist_0->hd, _fx_g14Parser__None2_, _fx_g14Parser__None2_, &ctx_0, &e_0), _fx_catch_4);

            _fx_catch_4: ;
               goto _fx_endmatch_1;
            }
         }
      }
   }
   if (elist_0 != 0) {
      _fx_LNt6option1N10Ast__exp_t v_9 = elist_0->tl;
      if (v_9 != 0) {
         if (v_9->tl == 0) {
            FX_CALL(
               _fx_M3AstFM8ExpRangeN10Ast__exp_t4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                  elist_0->hd, v_9->hd, _fx_g14Parser__None2_, &ctx_0, &e_0), _fx_catch_5);

         _fx_catch_5: ;
            goto _fx_endmatch_1;
         }
      }
   }
   if (elist_0 != 0) {
      _fx_LNt6option1N10Ast__exp_t v_10 = elist_0->tl;
      if (v_10 != 0) {
         _fx_LNt6option1N10Ast__exp_t v_11 = v_10->tl;
         if (v_11 != 0) {
            if (v_11->tl == 0) {
               FX_CALL(
                  _fx_M3AstFM8ExpRangeN10Ast__exp_t4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                     elist_0->hd, v_10->hd, v_11->hd, &ctx_0, &e_0), _fx_catch_6);

            _fx_catch_6: ;
               goto _fx_endmatch_1;
            }
         }
      }
   }
   fx_str_t v_12 = {0};
   fx_str_t v_13 = {0};
   fx_exn_t v_14 = {0};
   int_ v_15 = _fx_M6ParserFM6lengthi1LNt6option1N10Ast__exp_t(elist_0, 0);
   FX_CALL(_fx_F6stringS1i(v_15, &v_12, 0), _fx_catch_7);
   fx_str_t slit_2 = FX_MAKE_STR("invalid range expression of ");
   fx_str_t slit_3 = FX_MAKE_STR(" components");
   {
      const fx_str_t strs_0[] = { slit_2, v_12, slit_3 };
      FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_13), _fx_catch_7);
   }
   _fx_R10Ast__loc_t loc_3;
   if (ts0_0 != 0) {
      loc_3 = ts0_0->hd.t1;
   }
   else {
      loc_3 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_7);
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &v_13, &v_14), _fx_catch_7);
   FX_THROW(&v_14, true, _fx_catch_7);

_fx_catch_7: ;
   fx_free_exn(&v_14);
   FX_FREE_STR(&v_13);
   FX_FREE_STR(&v_12);

_fx_endmatch_1: ;
   FX_CHECK_EXN(_fx_cleanup);
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_0, e_0, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(&v_0);
   if (ts_0) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_0);
   }
   if (elist_0) {
      _fx_free_LNt6option1N10Ast__exp_t(&elist_0);
   }
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&ctx_0);
   if (e_0) {
      _fx_free_N10Ast__exp_t(&e_0);
   }
   return fx_status;
}

static int
   _fx_M6ParserFM12parse_range_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLNt6option1N10Ast__exp_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_sep_0,
   struct _fx_LNt6option1N10Ast__exp_t_data_t* result_0,
   bool allow_mkrecord_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LNt6option1N10Ast__exp_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_sep_1 = expect_sep_0;
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LNt6option1N10Ast__exp_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_sep_2 = expect_sep_1;
      FX_COPY_PTR(result_2, &result_3);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 56) {
            _fx_LNt6option1N10Ast__exp_t result_4 = 0;
            _fx_LNt6option1N10Ast__exp_t v_0 = 0;
            if (expect_sep_2) {
               FX_CALL(_fx_cons_LNt6option1N10Ast__exp_t(_fx_g14Parser__None2_, result_3, true, &result_4), _fx_catch_0);
            }
            else {
               FX_CALL(_fx_cons_LNt6option1N10Ast__exp_t(_fx_g14Parser__None2_, result_3, true, &v_0), _fx_catch_0);
               FX_CALL(_fx_cons_LNt6option1N10Ast__exp_t(_fx_g14Parser__None2_, v_0, true, &result_4), _fx_catch_0);
            }
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(*rest_0, &ts_1);
            expect_sep_1 = false;
            _fx_free_LNt6option1N10Ast__exp_t(&result_2);
            FX_COPY_PTR(result_4, &result_2);

         _fx_catch_0: ;
            if (v_0) {
               _fx_free_LNt6option1N10Ast__exp_t(&v_0);
            }
            if (result_4) {
               _fx_free_LNt6option1N10Ast__exp_t(&result_4);
            }
            goto _fx_endmatch_1;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 54) {
            _fx_LNt6option1N10Ast__exp_t result_5 = 0;
            if (expect_sep_2) {
               FX_COPY_PTR(result_3, &result_5);
            }
            else {
               FX_CALL(_fx_cons_LNt6option1N10Ast__exp_t(_fx_g14Parser__None2_, result_3, true, &result_5), _fx_catch_1);
            }
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &ts_2->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(*rest_1, &ts_1);
            expect_sep_1 = false;
            _fx_free_LNt6option1N10Ast__exp_t(&result_2);
            FX_COPY_PTR(result_5, &result_2);

         _fx_catch_1: ;
            if (result_5) {
               _fx_free_LNt6option1N10Ast__exp_t(&result_5);
            }
            goto _fx_endmatch_1;
         }
      }
      bool res_0;
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 49) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 19) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 40) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 48) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      res_0 = false;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_5);
      if (res_0) {
         fx_exn_t v_1 = {0};
         _fx_LNt6option1N10Ast__exp_t result_6 = 0;
         _fx_LNt6option1N10Ast__exp_t __fold_result___0 = 0;
         _fx_LNt6option1N10Ast__exp_t v_2 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t result_7 = {0};
         bool v_3;
         if (!expect_sep_2) {
            int_ v_4 = _fx_M6ParserFM6lengthi1LNt6option1N10Ast__exp_t(result_3, 0); v_3 = v_4 != 1;
         }
         else {
            v_3 = false;
         }
         if (v_3) {
            _fx_R10Ast__loc_t loc_0;
            if (ts_2 != 0) {
               loc_0 = ts_2->hd.t1;
            }
            else {
               loc_0 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_3);
            fx_str_t slit_0 = FX_MAKE_STR("range expression may not end with \':\', unless it\'s \':\' or \'<start>:\' ");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_1), _fx_catch_3);
            FX_THROW(&v_1, true, _fx_catch_3);
         }
         if (expect_sep_2) {
            FX_COPY_PTR(result_3, &result_6);
         }
         else {
            FX_CALL(_fx_cons_LNt6option1N10Ast__exp_t(_fx_g14Parser__None2_, result_3, true, &result_6), _fx_catch_3);
         }
         _fx_LNt6option1N10Ast__exp_t lst_0 = result_6;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_LNt6option1N10Ast__exp_t r_0 = 0;
            _fx_Nt6option1N10Ast__exp_t a_0 = lst_0->hd;
            FX_COPY_PTR(__fold_result___0, &r_0);
            FX_CALL(_fx_cons_LNt6option1N10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_2);
            _fx_free_LNt6option1N10Ast__exp_t(&__fold_result___0);
            FX_COPY_PTR(r_0, &__fold_result___0);

         _fx_catch_2: ;
            if (r_0) {
               _fx_free_LNt6option1N10Ast__exp_t(&r_0);
            }
            FX_CHECK_EXN(_fx_catch_3);
         }
         FX_COPY_PTR(__fold_result___0, &v_2);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(ts_2, v_2, &result_7);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(&result_7, &result_1);
         FX_BREAK(_fx_catch_3);

      _fx_catch_3: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(&result_7);
         if (v_2) {
            _fx_free_LNt6option1N10Ast__exp_t(&v_2);
         }
         if (__fold_result___0) {
            _fx_free_LNt6option1N10Ast__exp_t(&__fold_result___0);
         }
         if (result_6) {
            _fx_free_LNt6option1N10Ast__exp_t(&result_6);
         }
         fx_free_exn(&v_1);
         goto _fx_endmatch_1;
      }
      fx_exn_t v_5 = {0};
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_6 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
      _fx_N10Ast__exp_t e_0 = 0;
      _fx_Nt6option1N10Ast__exp_t v_7 = 0;
      _fx_LNt6option1N10Ast__exp_t v_8 = 0;
      if (expect_sep_2) {
         _fx_R10Ast__loc_t loc_1;
         if (ts_2 != 0) {
            loc_1 = ts_2->hd.t1;
         }
         else {
            loc_1 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_4);
         fx_str_t slit_1 = FX_MAKE_STR("\':\' is expected");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_5), _fx_catch_4);
         FX_THROW(&v_5, true, _fx_catch_4);
      }
      FX_CALL(
         _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_2,
            allow_mkrecord_0, &v_6, 0), _fx_catch_4);
      FX_COPY_PTR(v_6.t0, &ts_3);
      FX_COPY_PTR(v_6.t1, &e_0);
      FX_CALL(_fx_M6ParserFM4SomeNt6option1N10Ast__exp_t1N10Ast__exp_t(e_0, &v_7), _fx_catch_4);
      FX_CALL(_fx_cons_LNt6option1N10Ast__exp_t(v_7, result_3, true, &v_8), _fx_catch_4);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
      FX_COPY_PTR(ts_3, &ts_1);
      expect_sep_1 = true;
      _fx_free_LNt6option1N10Ast__exp_t(&result_2);
      FX_COPY_PTR(v_8, &result_2);

   _fx_catch_4: ;
      if (v_8) {
         _fx_free_LNt6option1N10Ast__exp_t(&v_8);
      }
      if (v_7) {
         _fx_free_Nt6option1N10Ast__exp_t(&v_7);
      }
      if (e_0) {
         _fx_free_N10Ast__exp_t(&e_0);
      }
      if (ts_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_6);
      fx_free_exn(&v_5);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_5);

   _fx_catch_5: ;
      if (result_3) {
         _fx_free_LNt6option1N10Ast__exp_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLNt6option1N10Ast__exp_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LNt6option1N10Ast__exp_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM15parse_imported_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t3LT2N14Lexer__token_tR10Ast__loc_tBLT2iR9Ast__id_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LT2iR9Ast__id_t_data_t* result_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LT2iR9Ast__id_t result_2 = 0;
   int fx_status = 0;
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT2iR9Ast__id_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(result_2, &result_3);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               FX_FREE_LIST_SIMPLE(&result_2);
               FX_COPY_PTR(result_3, &result_2);
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_1;
         }
      }
      if (ts_2 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_1 = &ts_2->hd;
         if (v_1->t0.tag == 2) {
            _fx_LT2iR9Ast__id_t __fold_result___0 = 0;
            _fx_LT2iR9Ast__id_t v_2 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t result_4 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS v_3 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
            fx_str_t i_0 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t v_4 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
            _fx_LT2iR9Ast__id_t v_5 = 0;
            if (expect_comma_2) {
               _fx_LT2iR9Ast__id_t lst_0 = result_3;
               for (; lst_0; lst_0 = lst_0->tl) {
                  _fx_LT2iR9Ast__id_t r_0 = 0;
                  _fx_T2iR9Ast__id_t* a_0 = &lst_0->hd;
                  FX_COPY_PTR(__fold_result___0, &r_0);
                  FX_CALL(_fx_cons_LT2iR9Ast__id_t(a_0, r_0, false, &r_0), _fx_catch_1);
                  FX_FREE_LIST_SIMPLE(&__fold_result___0);
                  FX_COPY_PTR(r_0, &__fold_result___0);

               _fx_catch_1: ;
                  FX_FREE_LIST_SIMPLE(&r_0);
                  FX_CHECK_EXN(_fx_catch_3);
               }
               FX_COPY_PTR(__fold_result___0, &v_2);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(ts_2, v_2, &result_4);
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(&result_1);
               _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(&result_4, &result_1);
               FX_BREAK(_fx_catch_3);
            }
            else {
               fx_str_t slit_1 = FX_MAKE_STR("");
               FX_CALL(
                  _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(ts_2,
                     false, &slit_1, &v_3, 0), _fx_catch_3);
               FX_COPY_PTR(v_3.t0, &ts_3);
               fx_copy_str(&v_3.t1, &i_0);
               _fx_R9Ast__id_t i_1;
               FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&i_0, &i_1, 0), _fx_catch_3);
               if (ts_3 != 0) {
                  if (ts_3->hd.t0.tag == 5) {
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t v_6 = ts_3->tl;
                     if (v_6 != 0) {
                        _fx_N14Lexer__token_t* v_7 = &v_6->hd.t0;
                        if (v_7->tag == 2) {
                           _fx_R9Ast__id_t v_8;
                           FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_7->u.IDENT.t1, &v_8, 0), _fx_catch_2);
                           _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(v_6->tl, &v_8, &v_4);

                        _fx_catch_2: ;
                           goto _fx_endmatch_0;
                        }
                     }
                  }
               }
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(ts_3, &i_1, &v_4);

            _fx_endmatch_0: ;
               FX_CHECK_EXN(_fx_catch_3);
               FX_COPY_PTR(v_4.t0, &ts_4);
               _fx_R9Ast__id_t j_0 = v_4.t1;
               int_ i__0;
               FX_CALL(_fx_M6ParserFM23add_to_imported_modulesi2R9Ast__id_tR10Ast__loc_t(&i_1, &v_1->t1, &i__0, 0),
                  _fx_catch_3);
               _fx_T2iR9Ast__id_t v_9 = { i__0, j_0 };
               FX_CALL(_fx_cons_LT2iR9Ast__id_t(&v_9, result_3, true, &v_5), _fx_catch_3);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(ts_4, &ts_1);
               expect_comma_1 = true;
               FX_FREE_LIST_SIMPLE(&result_2);
               FX_COPY_PTR(v_5, &result_2);
            }

         _fx_catch_3: ;
            FX_FREE_LIST_SIMPLE(&v_5);
            if (ts_4) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(&v_4);
            FX_FREE_STR(&i_0);
            if (ts_3) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&v_3);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(&result_4);
            FX_FREE_LIST_SIMPLE(&v_2);
            FX_FREE_LIST_SIMPLE(&__fold_result___0);
            goto _fx_endmatch_1;
         }
      }
      fx_exn_t v_10 = {0};
      _fx_LT2iR9Ast__id_t __fold_result___1 = 0;
      _fx_LT2iR9Ast__id_t v_11 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t result_5 = {0};
      if (result_3 == 0) {
         _fx_R10Ast__loc_t loc_1;
         if (ts_2 != 0) {
            loc_1 = ts_2->hd.t1;
         }
         else {
            loc_1 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_5);
         fx_str_t slit_2 = FX_MAKE_STR("empty module list");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_2, &v_10), _fx_catch_5);
         FX_THROW(&v_10, true, _fx_catch_5);
      }
      _fx_LT2iR9Ast__id_t lst_1 = result_3;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_LT2iR9Ast__id_t r_1 = 0;
         _fx_T2iR9Ast__id_t* a_1 = &lst_1->hd;
         FX_COPY_PTR(__fold_result___1, &r_1);
         FX_CALL(_fx_cons_LT2iR9Ast__id_t(a_1, r_1, false, &r_1), _fx_catch_4);
         FX_FREE_LIST_SIMPLE(&__fold_result___1);
         FX_COPY_PTR(r_1, &__fold_result___1);

      _fx_catch_4: ;
         FX_FREE_LIST_SIMPLE(&r_1);
         FX_CHECK_EXN(_fx_catch_5);
      }
      FX_COPY_PTR(__fold_result___1, &v_11);
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(ts_2, v_11, &result_5);
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(&result_1);
      _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(&result_5, &result_1);
      FX_BREAK(_fx_catch_5);

   _fx_catch_5: ;
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(&result_5);
      FX_FREE_LIST_SIMPLE(&v_11);
      FX_FREE_LIST_SIMPLE(&__fold_result___1);
      fx_free_exn(&v_10);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_6);

   _fx_catch_6: ;
      FX_FREE_LIST_SIMPLE(&result_3);
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   FX_FREE_LIST_SIMPLE(&result_2);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM13more_pragmas_T2LT2N14Lexer__token_tR10Ast__loc_tLS2LT2N14Lexer__token_tR10Ast__loc_tLS(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_LS_data_t* prl_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS result_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LS prl_1 = 0;
   int fx_status = 0;
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(prl_0, &prl_1);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LS prl_2 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(prl_1, &prl_2);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_0 = ts_2->tl;
            if (v_0 != 0) {
               _fx_T2N14Lexer__token_tR10Ast__loc_t* v_1 = &v_0->hd;
               _fx_N14Lexer__token_t* v_2 = &v_1->t0;
               if (v_2->tag == 1) {
                  fx_str_t pr_0 = {0};
                  _fx_LS v_3 = 0;
                  _fx_N10Ast__lit_t* lit_0 = &v_2->u.LITERAL;
                  if (lit_0->tag == 5) {
                     fx_copy_str(&lit_0->u.LitString, &pr_0);
                  }
                  else {
                     fx_exn_t v_4 = {0};
                     fx_str_t slit_0 = FX_MAKE_STR("string literal is expected");
                     FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&v_1->t1, &slit_0, &v_4), _fx_catch_0);
                     FX_THROW(&v_4, true, _fx_catch_0);

                  _fx_catch_0: ;
                     fx_free_exn(&v_4);
                  }
                  FX_CHECK_EXN(_fx_catch_1);
                  FX_CALL(_fx_cons_LS(&pr_0, prl_2, true, &v_3), _fx_catch_1);
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &v_0->tl;
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  FX_COPY_PTR(*rest_0, &ts_1);
                  _fx_free_LS(&prl_1);
                  FX_COPY_PTR(v_3, &prl_1);

               _fx_catch_1: ;
                  if (v_3) {
                     _fx_free_LS(&v_3);
                  }
                  FX_FREE_STR(&pr_0);
                  goto _fx_endmatch_0;
               }
            }
         }
      }
      _fx_LS __fold_result___0 = 0;
      _fx_LS v_5 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS result_1 = {0};
      _fx_LS lst_0 = prl_2;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_LS r_0 = 0;
         fx_str_t* a_0 = &lst_0->hd;
         FX_COPY_PTR(__fold_result___0, &r_0);
         FX_CALL(_fx_cons_LS(a_0, r_0, false, &r_0), _fx_catch_2);
         _fx_free_LS(&__fold_result___0);
         FX_COPY_PTR(r_0, &__fold_result___0);

      _fx_catch_2: ;
         if (r_0) {
            _fx_free_LS(&r_0);
         }
         FX_CHECK_EXN(_fx_catch_3);
      }
      FX_COPY_PTR(__fold_result___0, &v_5);
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLS(ts_2, v_5, &result_1);
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLS(&result_0);
      _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLS(&result_1, &result_0);
      FX_BREAK(_fx_catch_3);

   _fx_catch_3: ;
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLS(&result_1);
      if (v_5) {
         _fx_free_LS(&v_5);
      }
      if (__fold_result___0) {
         _fx_free_LS(&__fold_result___0);
      }

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_4);

   _fx_catch_4: ;
      if (prl_2) {
         _fx_free_LS(&prl_2);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLS(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLS(&result_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (prl_1) {
      _fx_free_LS(&prl_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM12parse_expseqT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool toplevel_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM14extend_expseq_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_tB(
         ts_0, 0, toplevel_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

static int
   _fx_M6ParserFM14extend_expseq_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_LN10Ast__exp_t_data_t* result_0,
   bool toplevel_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__exp_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LN10Ast__exp_t result_3 = 0;
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(result_2, &result_3);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 53) {
            fx_exn_t v_0 = {0};
            if (result_3 == 0) {
               fx_str_t slit_0 = FX_MAKE_STR("unexpected \';\' in the beginning of expression sequence");
               FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &slit_0, &v_0, 0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }
            FX_COPY_PTR(ts_2->tl, &ts_3);

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_0;
         }
      }
      FX_COPY_PTR(ts_2, &ts_3);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_19);
      bool res_0;
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 50) {
            res_0 = true; goto _fx_endmatch_1;
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 55) {
            res_0 = true; goto _fx_endmatch_1;
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 63) {
            res_0 = true; goto _fx_endmatch_1;
         }
      }
      res_0 = false;

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_19);
      if (res_0) {
         fx_exn_t v_1 = {0};
         _fx_LN10Ast__exp_t v_2 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t result_4 = {0};
         bool t_0;
         if (toplevel_0) {
            if (ts_3 != 0) {
               if (ts_3->hd.t0.tag == 63) {
                  t_0 = false; goto _fx_endmatch_2;
               }
            }
            t_0 = true;

         _fx_endmatch_2: ;
            FX_CHECK_EXN(_fx_catch_1);
         }
         else {
            t_0 = false;
         }
         if (t_0) {
            fx_str_t slit_1 = FX_MAKE_STR("unexpected \'}\'");
            FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_3, &slit_1, &v_1, 0), _fx_catch_1);
            FX_THROW(&v_1, true, _fx_catch_1);
         }
         FX_CALL(_fx_M6ParserFM3revLN10Ast__exp_t1LN10Ast__exp_t(result_3, &v_2, 0), _fx_catch_1);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(ts_3, v_2, &result_4);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_4, &result_1);
         FX_BREAK(_fx_catch_1);

      _fx_catch_1: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_4);
         if (v_2) {
            _fx_free_LN10Ast__exp_t(&v_2);
         }
         fx_free_exn(&v_1);
         goto _fx_endmatch_9;
      }
      bool res_1;
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 38) {
            res_1 = true; goto _fx_endmatch_3;
         }
      }
      if (ts_3 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_3 = ts_3->tl;
         if (v_3 != 0) {
            if (ts_3->hd.t0.tag == 31) {
               if (v_3->hd.t0.tag == 38) {
                  res_1 = true; goto _fx_endmatch_3;
               }
            }
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 39) {
            res_1 = true; goto _fx_endmatch_3;
         }
      }
      if (ts_3 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_4 = ts_3->tl;
         if (v_4 != 0) {
            if (ts_3->hd.t0.tag == 31) {
               if (v_4->hd.t0.tag == 39) {
                  res_1 = true; goto _fx_endmatch_3;
               }
            }
         }
      }
      res_1 = false;

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_19);
      if (res_1) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t v_5 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_LN10Ast__exp_t defvals_0 = 0;
         _fx_LN10Ast__exp_t v_6 = 0;
         FX_CALL(
            _fx_M6ParserFM13parse_defvalsT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_3, &v_5, 0), _fx_catch_2);
         FX_COPY_PTR(v_5.t0, &ts_4);
         FX_COPY_PTR(v_5.t1, &defvals_0);
         FX_CALL(_fx_M6ParserFM7__add__LN10Ast__exp_t2LN10Ast__exp_tLN10Ast__exp_t(defvals_0, result_3, &v_6, 0), _fx_catch_2);
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         FX_COPY_PTR(ts_4, &ts_1);
         _fx_free_LN10Ast__exp_t(&result_2);
         FX_COPY_PTR(v_6, &result_2);

      _fx_catch_2: ;
         if (v_6) {
            _fx_free_LN10Ast__exp_t(&v_6);
         }
         if (defvals_0) {
            _fx_free_LN10Ast__exp_t(&defvals_0);
         }
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&v_5);
         goto _fx_endmatch_9;
      }
      bool res_2;
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 37) {
            res_2 = true; goto _fx_endmatch_4;
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 10) {
            res_2 = true; goto _fx_endmatch_4;
         }
      }
      res_2 = false;

   _fx_endmatch_4: ;
      FX_CHECK_EXN(_fx_catch_19);
      if (res_2) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_7 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
         _fx_N10Ast__exp_t deftyp_0 = 0;
         _fx_LN10Ast__exp_t v_8 = 0;
         FX_CALL(
            _fx_M6ParserFM13parse_deftypeT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_3, &v_7, 0), _fx_catch_3);
         FX_COPY_PTR(v_7.t0, &ts_5);
         FX_COPY_PTR(v_7.t1, &deftyp_0);
         FX_CALL(_fx_cons_LN10Ast__exp_t(deftyp_0, result_3, true, &v_8), _fx_catch_3);
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         FX_COPY_PTR(ts_5, &ts_1);
         _fx_free_LN10Ast__exp_t(&result_2);
         FX_COPY_PTR(v_8, &result_2);

      _fx_catch_3: ;
         if (v_8) {
            _fx_free_LN10Ast__exp_t(&v_8);
         }
         if (deftyp_0) {
            _fx_free_N10Ast__exp_t(&deftyp_0);
         }
         if (ts_5) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_7);
         goto _fx_endmatch_9;
      }
      if (ts_3 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_9 = &ts_3->hd;
         if (v_9->t0.tag == 25) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_10 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
            _fx_N10Ast__exp_t defiface_0 = 0;
            _fx_LN10Ast__exp_t v_11 = 0;
            FX_CALL(
               _fx_M6ParserFM11parse_ifaceT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t(
                  ts_3->tl, &v_9->t1, &v_10, 0), _fx_catch_4);
            FX_COPY_PTR(v_10.t0, &ts_6);
            FX_COPY_PTR(v_10.t1, &defiface_0);
            FX_CALL(_fx_cons_LN10Ast__exp_t(defiface_0, result_3, true, &v_11), _fx_catch_4);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_6, &ts_1);
            _fx_free_LN10Ast__exp_t(&result_2);
            FX_COPY_PTR(v_11, &result_2);

         _fx_catch_4: ;
            if (v_11) {
               _fx_free_LN10Ast__exp_t(&v_11);
            }
            if (defiface_0) {
               _fx_free_N10Ast__exp_t(&defiface_0);
            }
            if (ts_6) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_10);
            goto _fx_endmatch_9;
         }
      }
      if (ts_3 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_12 = ts_3->tl;
         if (v_12 != 0) {
            if (ts_3->hd.t0.tag == 21) {
               if (v_12->hd.t0.tag == 44) {
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_13 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_7 = 0;
                  _fx_N10Ast__exp_t e_0 = 0;
                  _fx_LN10Ast__exp_t v_14 = 0;
                  FX_CALL(
                     _fx_M6ParserFM12parse_lambdaT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                        ts_3, &v_13, 0), _fx_catch_5);
                  FX_COPY_PTR(v_13.t0, &ts_7);
                  FX_COPY_PTR(v_13.t1, &e_0);
                  FX_CALL(_fx_cons_LN10Ast__exp_t(e_0, result_3, true, &v_14), _fx_catch_5);
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  FX_COPY_PTR(ts_7, &ts_1);
                  _fx_free_LN10Ast__exp_t(&result_2);
                  FX_COPY_PTR(v_14, &result_2);

               _fx_catch_5: ;
                  if (v_14) {
                     _fx_free_LN10Ast__exp_t(&v_14);
                  }
                  if (e_0) {
                     _fx_free_N10Ast__exp_t(&e_0);
                  }
                  if (ts_7) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_7);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_13);
                  goto _fx_endmatch_9;
               }
            }
         }
      }
      bool res_3;
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 31) {
            res_3 = true; goto _fx_endmatch_5;
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 32) {
            res_3 = true; goto _fx_endmatch_5;
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 27) {
            res_3 = true; goto _fx_endmatch_5;
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 24) {
            res_3 = true; goto _fx_endmatch_5;
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 21) {
            res_3 = true; goto _fx_endmatch_5;
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 28) {
            res_3 = true; goto _fx_endmatch_5;
         }
      }
      res_3 = false;

   _fx_endmatch_5: ;
      FX_CHECK_EXN(_fx_catch_19);
      if (res_3) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_15 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_8 = 0;
         _fx_N10Ast__exp_t defun_0 = 0;
         _fx_LN10Ast__exp_t v_16 = 0;
         FX_CALL(
            _fx_M6ParserFM11parse_defunT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_3,
               &v_15, 0), _fx_catch_6);
         FX_COPY_PTR(v_15.t0, &ts_8);
         FX_COPY_PTR(v_15.t1, &defun_0);
         FX_CALL(_fx_cons_LN10Ast__exp_t(defun_0, result_3, true, &v_16), _fx_catch_6);
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         FX_COPY_PTR(ts_8, &ts_1);
         _fx_free_LN10Ast__exp_t(&result_2);
         FX_COPY_PTR(v_16, &result_2);

      _fx_catch_6: ;
         if (v_16) {
            _fx_free_LN10Ast__exp_t(&v_16);
         }
         if (defun_0) {
            _fx_free_N10Ast__exp_t(&defun_0);
         }
         if (ts_8) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_8);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_15);
         goto _fx_endmatch_9;
      }
      if (ts_3 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_17 = &ts_3->hd;
         if (v_17->t0.tag == 16) {
            fx_exn_t v_18 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t v_19 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_9 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_20 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_10 = 0;
            _fx_N10Ast__typ_t t_1 = 0;
            _fx_R13Ast__defexn_t v_21 = {0};
            _fx_rR13Ast__defexn_t de_0 = 0;
            _fx_N10Ast__exp_t v_22 = 0;
            _fx_LN10Ast__exp_t v_23 = 0;
            _fx_LT2N14Lexer__token_tR10Ast__loc_t rest_0 = ts_3->tl;
            if (!toplevel_0) {
               fx_str_t slit_2 = FX_MAKE_STR("exceptions can only be defined at module level");
               FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_3, &slit_2, &v_18, 0), _fx_catch_10);
               FX_THROW(&v_18, true, _fx_catch_10);
            }
            if (rest_0 != 0) {
               _fx_N14Lexer__token_t* v_24 = &rest_0->hd.t0;
               if (v_24->tag == 2) {
                  fx_exn_t v_25 = {0};
                  fx_str_t* i_0 = &v_24->u.IDENT.t1;
                  bool v_26;
                  FX_CALL(_fx_M6ParserFM17good_variant_nameB1S(i_0, &v_26, 0), _fx_catch_7);
                  if (!v_26) {
                     fx_str_t slit_3 = FX_MAKE_STR("exception name should start with a capital letter (A..Z)");
                     FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_3, &slit_3, &v_25, 0),
                        _fx_catch_7);
                     FX_THROW(&v_25, true, _fx_catch_7);
                  }
                  _fx_R9Ast__id_t v_27;
                  FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(i_0, &v_27, 0), _fx_catch_7);
                  _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(rest_0->tl, &v_27, &v_19);

               _fx_catch_7: ;
                  fx_free_exn(&v_25);
                  goto _fx_endmatch_6;
               }
            }
            fx_exn_t v_28 = {0};
            fx_str_t slit_4 = FX_MAKE_STR("identifier is expected");
            FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(rest_0, &slit_4, &v_28, 0), _fx_catch_8);
            FX_THROW(&v_28, true, _fx_catch_8);

         _fx_catch_8: ;
            fx_free_exn(&v_28);

         _fx_endmatch_6: ;
            FX_CHECK_EXN(_fx_catch_10);
            FX_COPY_PTR(v_19.t0, &ts_9);
            _fx_R9Ast__id_t i_1 = v_19.t1;
            if (ts_9 != 0) {
               if (ts_9->hd.t0.tag == 54) {
                  FX_CALL(
                     _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
                        ts_9->tl, &v_20, 0), _fx_catch_9);

               _fx_catch_9: ;
                  goto _fx_endmatch_7;
               }
            }
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(ts_9, _fx_g15Parser__TypVoid, &v_20);

         _fx_endmatch_7: ;
            FX_CHECK_EXN(_fx_catch_10);
            FX_COPY_PTR(v_20.t0, &ts_10);
            FX_COPY_PTR(v_20.t1, &t_1);
            _fx_make_R13Ast__defexn_t(&i_1, t_1, 0, &v_17->t1, &v_21);
            FX_CALL(_fx_make_rR13Ast__defexn_t(&v_21, &de_0), _fx_catch_10);
            FX_CALL(_fx_M3AstFM6DefExnN10Ast__exp_t1rRM8defexn_t(de_0, &v_22), _fx_catch_10);
            FX_CALL(_fx_cons_LN10Ast__exp_t(v_22, result_3, true, &v_23), _fx_catch_10);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_10, &ts_1);
            _fx_free_LN10Ast__exp_t(&result_2);
            FX_COPY_PTR(v_23, &result_2);

         _fx_catch_10: ;
            if (v_23) {
               _fx_free_LN10Ast__exp_t(&v_23);
            }
            if (v_22) {
               _fx_free_N10Ast__exp_t(&v_22);
            }
            if (de_0) {
               _fx_free_rR13Ast__defexn_t(&de_0);
            }
            _fx_free_R13Ast__defexn_t(&v_21);
            if (t_1) {
               _fx_free_N10Ast__typ_t(&t_1);
            }
            if (ts_10) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_10);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_20);
            if (ts_9) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_9);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(&v_19);
            fx_free_exn(&v_18);
            goto _fx_endmatch_9;
         }
      }
      if (ts_3 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_29 = &ts_3->hd;
         _fx_N14Lexer__token_t* v_30 = &v_29->t0;
         if (v_30->tag == 23) {
            fx_exn_t v_31 = {0};
            fx_exn_t v_32 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t v_33 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_11 = 0;
            _fx_LT2iR9Ast__id_t imported_0 = 0;
            _fx_N10Ast__exp_t v_34 = 0;
            _fx_LN10Ast__exp_t v_35 = 0;
            if (!toplevel_0) {
               fx_str_t slit_5 = FX_MAKE_STR("import directives can only be used at the module level");
               FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_3, &slit_5, &v_31, 0), _fx_catch_11);
               FX_THROW(&v_31, true, _fx_catch_11);
            }
            if (!v_30->u.IMPORT) {
               fx_str_t slit_6 = FX_MAKE_STR("\';\' or newline is expected before the import directive");
               FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_3, &slit_6, &v_32, 0), _fx_catch_11);
               FX_THROW(&v_32, true, _fx_catch_11);
            }
            FX_CALL(
               _fx_M6ParserFM15parse_imported_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t3LT2N14Lexer__token_tR10Ast__loc_tBLT2iR9Ast__id_t(
                  ts_3->tl, false, 0, &v_33, 0), _fx_catch_11);
            FX_COPY_PTR(v_33.t0, &ts_11);
            FX_COPY_PTR(v_33.t1, &imported_0);
            FX_CALL(_fx_M3AstFM9DirImportN10Ast__exp_t2LT2iRM4id_tRM5loc_t(imported_0, &v_29->t1, &v_34), _fx_catch_11);
            FX_CALL(_fx_cons_LN10Ast__exp_t(v_34, result_3, true, &v_35), _fx_catch_11);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_11, &ts_1);
            _fx_free_LN10Ast__exp_t(&result_2);
            FX_COPY_PTR(v_35, &result_2);

         _fx_catch_11: ;
            if (v_35) {
               _fx_free_LN10Ast__exp_t(&v_35);
            }
            if (v_34) {
               _fx_free_N10Ast__exp_t(&v_34);
            }
            FX_FREE_LIST_SIMPLE(&imported_0);
            if (ts_11) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_11);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2iR9Ast__id_t(&v_33);
            fx_free_exn(&v_32);
            fx_free_exn(&v_31);
            goto _fx_endmatch_9;
         }
      }
      if (ts_3 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_36 = &ts_3->hd;
         if (v_36->t0.tag == 20) {
            fx_exn_t v_37 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS v_38 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_12 = 0;
            fx_str_t m__0 = {0};
            _fx_R10Ast__loc_t* l1_0 = &v_36->t1;
            if (!toplevel_0) {
               fx_str_t slit_7 = FX_MAKE_STR("import directives can only be used at the module level");
               FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_3, &slit_7, &v_37, 0), _fx_catch_15);
               FX_THROW(&v_37, true, _fx_catch_15);
            }
            fx_str_t slit_8 = FX_MAKE_STR("");
            FX_CALL(
               _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(ts_3->tl,
                  false, &slit_8, &v_38, 0), _fx_catch_15);
            FX_COPY_PTR(v_38.t0, &ts_12);
            fx_copy_str(&v_38.t1, &m__0);
            _fx_R9Ast__id_t m_0;
            FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&m__0, &m_0, 0), _fx_catch_15);
            int_ m__1;
            FX_CALL(_fx_M6ParserFM23add_to_imported_modulesi2R9Ast__id_tR10Ast__loc_t(&m_0, l1_0, &m__1, 0), _fx_catch_15);
            if (ts_12 != 0) {
               if (ts_12->hd.t0.tag == 23) {
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t v_39 = ts_12->tl;
                  if (v_39 != 0) {
                     if (v_39->hd.t0.tag == 66) {
                        _fx_N10Ast__exp_t v_40 = 0;
                        _fx_LN10Ast__exp_t v_41 = 0;
                        FX_CALL(_fx_M3AstFM13DirImportFromN10Ast__exp_t3iLRM4id_tRM5loc_t(m__1, 0, l1_0, &v_40), _fx_catch_12);
                        FX_CALL(_fx_cons_LN10Ast__exp_t(v_40, result_3, true, &v_41), _fx_catch_12);
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &v_39->tl;
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                        FX_COPY_PTR(*rest_1, &ts_1);
                        _fx_free_LN10Ast__exp_t(&result_2);
                        FX_COPY_PTR(v_41, &result_2);

                     _fx_catch_12: ;
                        if (v_41) {
                           _fx_free_LN10Ast__exp_t(&v_41);
                        }
                        if (v_40) {
                           _fx_free_N10Ast__exp_t(&v_40);
                        }
                        goto _fx_endmatch_8;
                     }
                  }
               }
            }
            if (ts_12 != 0) {
               if (ts_12->hd.t0.tag == 23) {
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t v_42 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_13 = 0;
                  _fx_LR9Ast__id_t il_0 = 0;
                  _fx_N10Ast__exp_t v_43 = 0;
                  _fx_LN10Ast__exp_t v_44 = 0;
                  FX_CALL(
                     _fx_M6ParserFM16parse_ident_listT2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t4LT2N14Lexer__token_tR10Ast__loc_tBBLR9Ast__id_t(
                        ts_12->tl, false, false, 0, &v_42, 0), _fx_catch_13);
                  FX_COPY_PTR(v_42.t0, &ts_13);
                  FX_COPY_PTR(v_42.t1, &il_0);
                  FX_CALL(_fx_M3AstFM13DirImportFromN10Ast__exp_t3iLRM4id_tRM5loc_t(m__1, il_0, l1_0, &v_43), _fx_catch_13);
                  FX_CALL(_fx_cons_LN10Ast__exp_t(v_43, result_3, true, &v_44), _fx_catch_13);
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  FX_COPY_PTR(ts_13, &ts_1);
                  _fx_free_LN10Ast__exp_t(&result_2);
                  FX_COPY_PTR(v_44, &result_2);

               _fx_catch_13: ;
                  if (v_44) {
                     _fx_free_LN10Ast__exp_t(&v_44);
                  }
                  if (v_43) {
                     _fx_free_N10Ast__exp_t(&v_43);
                  }
                  FX_FREE_LIST_SIMPLE(&il_0);
                  if (ts_13) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_13);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&v_42);
                  goto _fx_endmatch_8;
               }
            }
            fx_exn_t v_45 = {0};
            fx_str_t slit_9 = FX_MAKE_STR("\'import\' is expected");
            FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_12, &slit_9, &v_45, 0), _fx_catch_14);
            FX_THROW(&v_45, true, _fx_catch_14);

         _fx_catch_14: ;
            fx_free_exn(&v_45);

         _fx_endmatch_8: ;
            FX_CHECK_EXN(_fx_catch_15);

         _fx_catch_15: ;
            FX_FREE_STR(&m__0);
            if (ts_12) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_12);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&v_38);
            fx_free_exn(&v_37);
            goto _fx_endmatch_9;
         }
      }
      if (ts_3 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_46 = ts_3->tl;
         if (v_46 != 0) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_47 = &v_46->hd;
            _fx_N14Lexer__token_t* v_48 = &v_47->t0;
            if (v_48->tag == 1) {
               if (ts_3->hd.t0.tag == 30) {
                  fx_exn_t v_49 = {0};
                  fx_str_t pr_0 = {0};
                  _fx_LS v_50 = 0;
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLS v_51 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_14 = 0;
                  _fx_LS prl_0 = 0;
                  _fx_N10Ast__exp_t v_52 = 0;
                  _fx_LN10Ast__exp_t v_53 = 0;
                  _fx_R10Ast__loc_t* l2_0 = &v_47->t1;
                  if (!toplevel_0) {
                     fx_str_t slit_10 = FX_MAKE_STR("pragma directives can only be used at the module level");
                     FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_3, &slit_10, &v_49, 0),
                        _fx_catch_16);
                     FX_THROW(&v_49, true, _fx_catch_16);
                  }
                  FX_CALL(_fx_M6ParserFM10get_stringS2N10Ast__lit_tR10Ast__loc_t(&v_48->u.LITERAL, l2_0, &pr_0, 0),
                     _fx_catch_16);
                  FX_CALL(_fx_cons_LS(&pr_0, 0, true, &v_50), _fx_catch_16);
                  FX_CALL(
                     _fx_M6ParserFM13more_pragmas_T2LT2N14Lexer__token_tR10Ast__loc_tLS2LT2N14Lexer__token_tR10Ast__loc_tLS(
                        v_46->tl, v_50, &v_51, 0), _fx_catch_16);
                  FX_COPY_PTR(v_51.t0, &ts_14);
                  FX_COPY_PTR(v_51.t1, &prl_0);
                  FX_CALL(_fx_M3AstFM9DirPragmaN10Ast__exp_t2LSRM5loc_t(prl_0, l2_0, &v_52), _fx_catch_16);
                  FX_CALL(_fx_cons_LN10Ast__exp_t(v_52, result_3, true, &v_53), _fx_catch_16);
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  FX_COPY_PTR(ts_14, &ts_1);
                  _fx_free_LN10Ast__exp_t(&result_2);
                  FX_COPY_PTR(v_53, &result_2);

               _fx_catch_16: ;
                  if (v_53) {
                     _fx_free_LN10Ast__exp_t(&v_53);
                  }
                  if (v_52) {
                     _fx_free_N10Ast__exp_t(&v_52);
                  }
                  if (prl_0) {
                     _fx_free_LS(&prl_0);
                  }
                  if (ts_14) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_14);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLS(&v_51);
                  if (v_50) {
                     _fx_free_LS(&v_50);
                  }
                  FX_FREE_STR(&pr_0);
                  fx_free_exn(&v_49);
                  goto _fx_endmatch_9;
               }
            }
         }
      }
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 9) {
            fx_exn_t v_54 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_55 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_15 = 0;
            _fx_N10Ast__exp_t e_1 = 0;
            _fx_LN10Ast__exp_t v_56 = 0;
            if (!toplevel_0) {
               fx_str_t slit_11 =
                  FX_MAKE_STR("C code is only allowed at the top level or as rhs of function or value definition");
               FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_3, &slit_11, &v_54, 0), _fx_catch_17);
               FX_THROW(&v_54, true, _fx_catch_17);
            }
            FX_CALL(
               _fx_M6ParserFM15parse_ccode_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
                  ts_3, _fx_g15Parser__TypVoid, &v_55, 0), _fx_catch_17);
            FX_COPY_PTR(v_55.t0, &ts_15);
            FX_COPY_PTR(v_55.t1, &e_1);
            FX_CALL(_fx_cons_LN10Ast__exp_t(e_1, result_3, true, &v_56), _fx_catch_17);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_15, &ts_1);
            _fx_free_LN10Ast__exp_t(&result_2);
            FX_COPY_PTR(v_56, &result_2);

         _fx_catch_17: ;
            if (v_56) {
               _fx_free_LN10Ast__exp_t(&v_56);
            }
            if (e_1) {
               _fx_free_N10Ast__exp_t(&e_1);
            }
            if (ts_15) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_15);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_55);
            fx_free_exn(&v_54);
            goto _fx_endmatch_9;
         }
      }
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_57 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_16 = 0;
      _fx_N10Ast__exp_t e_2 = 0;
      _fx_LN10Ast__exp_t v_58 = 0;
      FX_CALL(
         _fx_M6ParserFM10parse_stmtT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_3,
            &v_57, 0), _fx_catch_18);
      FX_COPY_PTR(v_57.t0, &ts_16);
      FX_COPY_PTR(v_57.t1, &e_2);
      FX_CALL(_fx_cons_LN10Ast__exp_t(e_2, result_3, true, &v_58), _fx_catch_18);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
      FX_COPY_PTR(ts_16, &ts_1);
      _fx_free_LN10Ast__exp_t(&result_2);
      FX_COPY_PTR(v_58, &result_2);

   _fx_catch_18: ;
      if (v_58) {
         _fx_free_LN10Ast__exp_t(&v_58);
      }
      if (e_2) {
         _fx_free_N10Ast__exp_t(&e_2);
      }
      if (ts_16) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_16);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_57);

   _fx_endmatch_9: ;
      FX_CHECK_EXN(_fx_catch_19);

   _fx_catch_19: ;
      if (ts_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
      }
      if (result_3) {
         _fx_free_LN10Ast__exp_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LN10Ast__exp_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM17parse_for_clause_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t_data_t* result_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(result_0, &result_2);
   _fx_R10Ast__loc_t loc_1 = *loc_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(result_2, &result_3);
      _fx_R10Ast__loc_t loc_2 = loc_1;
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&result_2);
               FX_COPY_PTR(result_3, &result_2);
               loc_1 = loc_2;
            }
            else {
               _fx_R10Ast__loc_t loc_3;
               if (ts_2 != 0) {
                  loc_3 = ts_2->hd.t1;
               }
               else {
                  loc_3 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_3;
         }
      }
      bool res_0;
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 19) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 40) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 49) {
            if (expect_comma_2) {
               res_0 = true; goto _fx_endmatch_0;
            }
         }
      }
      res_0 = false;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_7);
      if (res_0) {
         fx_exn_t v_1 = {0};
         _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t __fold_result___0 = 0;
         _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t v_2 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t result_4 = {0};
         if (result_3 == 0) {
            _fx_R10Ast__loc_t loc_4;
            if (ts_2 != 0) {
               loc_4 = ts_2->hd.t1;
            }
            else {
               loc_4 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_2);
            fx_str_t slit_1 = FX_MAKE_STR("empty for? (need at least one <iter_pat> <- <iter_range or collection>)");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_4, &slit_1, &v_1), _fx_catch_2);
            FX_THROW(&v_1, true, _fx_catch_2);
         }
         _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t lst_0 = result_3;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t r_0 = 0;
            _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* a_0 = &lst_0->hd;
            FX_COPY_PTR(__fold_result___0, &r_0);
            FX_CALL(_fx_cons_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_1);
            _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&__fold_result___0);
            FX_COPY_PTR(r_0, &__fold_result___0);

         _fx_catch_1: ;
            if (r_0) {
               _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&r_0);
            }
            FX_CHECK_EXN(_fx_catch_2);
         }
         FX_COPY_PTR(__fold_result___0, &v_2);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(ts_2, v_2, &result_4);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&result_4, &result_1);
         FX_BREAK(_fx_catch_2);

      _fx_catch_2: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&result_4);
         if (v_2) {
            _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&v_2);
         }
         if (__fold_result___0) {
            _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&__fold_result___0);
         }
         fx_free_exn(&v_1);
         goto _fx_endmatch_3;
      }
      fx_exn_t v_3 = {0};
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_4 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
      _fx_N10Ast__pat_t p_0 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_5 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
      _fx_N10Ast__pat_t idx_pat_0 = 0;
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_6 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
      _fx_N10Ast__exp_t e_0 = 0;
      _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t v_7 = {0};
      _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t v_8 = 0;
      if (expect_comma_2) {
         _fx_R10Ast__loc_t loc_5;
         if (ts_2 != 0) {
            loc_5 = ts_2->hd.t1;
         }
         else {
            loc_5 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_6);
         fx_str_t slit_2 = FX_MAKE_STR("\',\' is expected");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_5, &slit_2, &v_3), _fx_catch_6);
         FX_THROW(&v_3, true, _fx_catch_6);
      }
      FX_CALL(
         _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_2, true,
            &v_4, 0), _fx_catch_6);
      FX_COPY_PTR(v_4.t0, &ts_3);
      FX_COPY_PTR(v_4.t1, &p_0);
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 6) {
            FX_CALL(
               _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_3->tl, true, &v_5, 0), _fx_catch_3);

         _fx_catch_3: ;
            goto _fx_endmatch_1;
         }
      }
      _fx_N10Ast__pat_t v_9 = 0;
      FX_CALL(_fx_M3AstFM6PatAnyN10Ast__pat_t1RM5loc_t(&loc_2, &v_9), _fx_catch_4);
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_3, v_9, &v_5);

   _fx_catch_4: ;
      if (v_9) {
         _fx_free_N10Ast__pat_t(&v_9);
      }

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_6);
      FX_COPY_PTR(v_5.t0, &ts_4);
      FX_COPY_PTR(v_5.t1, &idx_pat_0);
      if (ts_4 != 0) {
         if (ts_4->hd.t0.tag == 59) {
            FX_COPY_PTR(ts_4->tl, &ts_5); goto _fx_endmatch_2;
         }
      }
      fx_exn_t v_10 = {0};
      _fx_R10Ast__loc_t loc_6;
      if (ts_4 != 0) {
         loc_6 = ts_4->hd.t1;
      }
      else {
         loc_6 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_5);
      fx_str_t slit_3 = FX_MAKE_STR("\'<-\' is expected");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_6, &slit_3, &v_10), _fx_catch_5);
      FX_THROW(&v_10, true, _fx_catch_5);

   _fx_catch_5: ;
      fx_free_exn(&v_10);

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_6);
      FX_CALL(
         _fx_M6ParserFM15parse_range_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
            ts_5, false, &v_6, 0), _fx_catch_6);
      FX_COPY_PTR(v_6.t0, &ts_6);
      FX_COPY_PTR(v_6.t1, &e_0);
      _fx_make_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(p_0, idx_pat_0, e_0, &v_7);
      FX_CALL(_fx_cons_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&v_7, result_3, true, &v_8), _fx_catch_6);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
      FX_COPY_PTR(ts_6, &ts_1);
      expect_comma_1 = true;
      _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&result_2);
      FX_COPY_PTR(v_8, &result_2);
      loc_1 = loc_2;

   _fx_catch_6: ;
      if (v_8) {
         _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&v_8);
      }
      _fx_free_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&v_7);
      if (e_0) {
         _fx_free_N10Ast__exp_t(&e_0);
      }
      if (ts_6) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_6);
      if (ts_5) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
      }
      if (idx_pat_0) {
         _fx_free_N10Ast__pat_t(&idx_pat_0);
      }
      if (ts_4) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_5);
      if (p_0) {
         _fx_free_N10Ast__pat_t(&p_0);
      }
      if (ts_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_4);
      fx_free_exn(&v_3);

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_7);

   _fx_catch_7: ;
      if (result_3) {
         _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM9parse_forT3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN15Ast__for_make_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N15Ast__for_make_t* for_make_0,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t nested_fors_0 = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t vts_0 = 0;
   _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t nested_fors_1 = 0;
   _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t __fold_result___0 =
      {0};
   _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t v_0 = {0};
   _fx_LN10Ast__exp_t glob_el_0 = 0;
   _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t nested_fors_2 = 0;
   _fx_LN10Ast__exp_t v_1 = 0;
   _fx_N10Ast__exp_t for_iter_exp_0 = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t vts_1 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_2 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t body_0 = 0;
   _fx_N10Ast__exp_t for_exp_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   bool is_parallel_0 = false;
   bool need_unzip_0 = false;
   FX_COPY_PTR(ts_0, &vts_0);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t vts_2 = 0;
      FX_COPY_PTR(vts_0, &vts_2);
      if (vts_2 != 0) {
         if (vts_2->hd.t0.tag == 29) {
            fx_exn_t v_3 = {0};
            if (is_parallel_0) {
               fx_str_t slit_0 = FX_MAKE_STR("duplicate @parallel attribute");
               FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_0, &slit_0, &v_3, 0), _fx_catch_0);
               FX_THROW(&v_3, true, _fx_catch_0);
            }
            is_parallel_0 = true;
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &vts_2->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
            FX_COPY_PTR(*rest_0, &vts_0);

         _fx_catch_0: ;
            fx_free_exn(&v_3);
            goto _fx_endmatch_0;
         }
      }
      if (vts_2 != 0) {
         if (vts_2->hd.t0.tag == 43) {
            fx_exn_t v_4 = {0};
            if (need_unzip_0) {
               fx_str_t slit_1 = FX_MAKE_STR("duplicate @unzip attribute");
               FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_0, &slit_1, &v_4, 0), _fx_catch_1);
               FX_THROW(&v_4, true, _fx_catch_1);
            }
            need_unzip_0 = true;
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &vts_2->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
            FX_COPY_PTR(*rest_1, &vts_0);

         _fx_catch_1: ;
            fx_free_exn(&v_4);
            goto _fx_endmatch_0;
         }
      }
      if (vts_2 != 0) {
         if (vts_2->hd.t0.tag == 19) {
            FX_BREAK(_fx_catch_2);  _fx_catch_2: ; goto _fx_endmatch_0;
         }
      }
      fx_exn_t v_5 = {0};
      fx_str_t slit_2 = FX_MAKE_STR("\'for\' is expected (after optional attributes)");
      FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(vts_0, &slit_2, &v_5, 0), _fx_catch_3);
      FX_THROW(&v_5, true, _fx_catch_3);

   _fx_catch_3: ;
      fx_free_exn(&v_5);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_4);

   _fx_catch_4: ;
      if (vts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t vts_3 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t v_6 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t for_cl_0 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t v_7 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
      _fx_Nt6option1N10Ast__exp_t when_e_0 = 0;
      _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t v_8 = {0};
      _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t v_9 = 0;
      _fx_R10Ast__loc_t loc_i_0 = _fx_g10Ast__noloc;
      FX_COPY_PTR(vts_0, &vts_3);
      if (vts_3 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_10 = &vts_3->hd;
         if (v_10->t0.tag == 19) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_2 = &vts_3->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
            FX_COPY_PTR(*rest_2, &vts_0);
            loc_i_0 = v_10->t1;
            goto _fx_endmatch_1;
         }
      }
      _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t v_11 = 0;
      FX_CALL(
         _fx_M6ParserFM3revLT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t1LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(
            nested_fors_0, &v_11, 0), _fx_catch_5);
      _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&nested_fors_0);
      FX_COPY_PTR(v_11, &nested_fors_0);
      FX_BREAK(_fx_catch_5);

   _fx_catch_5: ;
      if (v_11) {
         _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_11);
      }

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_7);
      FX_CALL(
         _fx_M6ParserFM17parse_for_clause_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
            vts_0, false, 0, &loc_i_0, &v_6, 0), _fx_catch_7);
      FX_COPY_PTR(v_6.t0, &ts_2);
      FX_COPY_PTR(v_6.t1, &for_cl_0);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 40) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_12 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
            _fx_N10Ast__exp_t e_0 = 0;
            _fx_Nt6option1N10Ast__exp_t v_13 = 0;
            FX_CALL(
               _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_2->tl, false, &v_12, 0), _fx_catch_6);
            FX_COPY_PTR(v_12.t0, &ts_4);
            FX_COPY_PTR(v_12.t1, &e_0);
            FX_CALL(_fx_M6ParserFM4SomeNt6option1N10Ast__exp_t1N10Ast__exp_t(e_0, &v_13), _fx_catch_6);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t(ts_4, v_13, &v_7);

         _fx_catch_6: ;
            if (v_13) {
               _fx_free_Nt6option1N10Ast__exp_t(&v_13);
            }
            if (e_0) {
               _fx_free_N10Ast__exp_t(&e_0);
            }
            if (ts_4) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_12);
            goto _fx_endmatch_2;
         }
      }
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t(ts_2, _fx_g14Parser__None2_, &v_7);

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_7);
      FX_COPY_PTR(v_7.t0, &ts_3);
      FX_COPY_PTR(v_7.t1, &when_e_0);
      _fx_make_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(for_cl_0, when_e_0, &loc_i_0,
         &v_8);
      FX_CALL(
         _fx_cons_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_8, nested_fors_0, true,
            &v_9), _fx_catch_7);
      _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&nested_fors_0);
      FX_COPY_PTR(v_9, &nested_fors_0);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
      FX_COPY_PTR(ts_3, &vts_0);

   _fx_catch_7: ;
      if (v_9) {
         _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_9);
      }
      _fx_free_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_8);
      if (when_e_0) {
         _fx_free_Nt6option1N10Ast__exp_t(&when_e_0);
      }
      if (ts_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tNt6option1N10Ast__exp_t(&v_7);
      if (for_cl_0) {
         _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&for_cl_0);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&v_6);
      if (vts_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_3);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(nested_fors_0, &nested_fors_1);
   _fx_R10Ast__loc_t glob_loc_0;
   if (nested_fors_1 != 0) {
      glob_loc_0 = nested_fors_1->hd.t2;
   }
   else {
      glob_loc_0 = _fx_g10Ast__noloc;
   }
   FX_CHECK_EXN(_fx_cleanup);
   _fx_make_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(0, 0,
      &__fold_result___0);
   _fx_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t lst_0 = nested_fors_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t ppe_list_0 = 0;
      _fx_Nt6option1N10Ast__exp_t when_e_1 = 0;
      _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t v_14 = {0};
      _fx_LN10Ast__exp_t glob_el_1 = 0;
      _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t nested_fors_3 = 0;
      _fx_N10Ast__pat_t v_15 = 0;
      _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t __fold_result___1 = {0};
      _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t v_16 = {0};
      _fx_LN10Ast__exp_t glob_el_2 = 0;
      _fx_LT2N10Ast__pat_tN10Ast__exp_t for_cl__0 = 0;
      _fx_N10Ast__pat_t idx_pat_0 = 0;
      _fx_LT2N10Ast__pat_tN10Ast__exp_t v_17 = 0;
      _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t v_18 = {0};
      _fx_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t v_19 = {0};
      _fx_T3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t* __pat___0 = &lst_0->hd;
      FX_COPY_PTR(__pat___0->t0, &ppe_list_0);
      FX_COPY_PTR(__pat___0->t1, &when_e_1);
      _fx_R10Ast__loc_t loc_0 = __pat___0->t2;
      _fx_copy_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
         &__fold_result___0, &v_14);
      FX_COPY_PTR(v_14.t0, &glob_el_1);
      FX_COPY_PTR(v_14.t1, &nested_fors_3);
      FX_CALL(_fx_M3AstFM6PatAnyN10Ast__pat_t1RM5loc_t(&loc_0, &v_15), _fx_catch_12);
      _fx_make_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(glob_el_1, 0, v_15, &__fold_result___1);
      _fx_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t lst_1 = ppe_list_0;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_N10Ast__pat_t p_0 = 0;
         _fx_N10Ast__pat_t idxp_0 = 0;
         _fx_N10Ast__exp_t e_1 = 0;
         _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t v_20 = {0};
         _fx_LN10Ast__exp_t glob_el_3 = 0;
         _fx_LT2N10Ast__pat_tN10Ast__exp_t for_cl__1 = 0;
         _fx_N10Ast__pat_t idx_pat_1 = 0;
         _fx_LN10Ast__pat_t v_21 = 0;
         _fx_T2LN10Ast__pat_tN10Ast__exp_t v_22 = {0};
         _fx_LN10Ast__pat_t p__0 = 0;
         _fx_N10Ast__exp_t p_e_0 = 0;
         _fx_N10Ast__pat_t p_1 = 0;
         _fx_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t v_23 = {0};
         _fx_T3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t* __pat___1 = &lst_1->hd;
         FX_COPY_PTR(__pat___1->t0, &p_0);
         FX_COPY_PTR(__pat___1->t1, &idxp_0);
         FX_COPY_PTR(__pat___1->t2, &e_1);
         _fx_copy_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&__fold_result___1, &v_20);
         FX_COPY_PTR(v_20.t0, &glob_el_3);
         FX_COPY_PTR(v_20.t1, &for_cl__1);
         FX_COPY_PTR(v_20.t2, &idx_pat_1);
         FX_CALL(_fx_cons_LN10Ast__pat_t(p_0, 0, true, &v_21), _fx_catch_11);
         _fx_R10Ast__loc_t v_24;
         FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(p_0, &v_24, 0), _fx_catch_11);
         FX_CALL(_fx_M6ParserFM9plist2expT2LN10Ast__pat_tN10Ast__exp_t2LN10Ast__pat_tR10Ast__loc_t(v_21, &v_24, &v_22, 0),
            _fx_catch_11);
         FX_COPY_PTR(v_22.t0, &p__0);
         FX_COPY_PTR(v_22.t1, &p_e_0);
         FX_CALL(_fx_M6ParserFM2hdN10Ast__pat_t1LN10Ast__pat_t(p__0, &p_1, 0), _fx_catch_11);
         if (FX_REC_VARIANT_TAG(idxp_0) == 1) {
            _fx_LN10Ast__exp_t v_25 = 0;
            _fx_T2N10Ast__pat_tN10Ast__exp_t v_26 = {0};
            _fx_LT2N10Ast__pat_tN10Ast__exp_t v_27 = 0;
            FX_CALL(_fx_cons_LN10Ast__exp_t(p_e_0, glob_el_3, true, &v_25), _fx_catch_8);
            _fx_make_T2N10Ast__pat_tN10Ast__exp_t(p_1, e_1, &v_26);
            FX_CALL(_fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(&v_26, for_cl__1, true, &v_27), _fx_catch_8);
            _fx_make_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(v_25, v_27, idx_pat_1, &v_23);

         _fx_catch_8: ;
            if (v_27) {
               _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&v_27);
            }
            _fx_free_T2N10Ast__pat_tN10Ast__exp_t(&v_26);
            if (v_25) {
               _fx_free_LN10Ast__exp_t(&v_25);
            }
         }
         else if (FX_REC_VARIANT_TAG(idx_pat_1) == 1) {
            _fx_LN10Ast__pat_t v_28 = 0;
            _fx_T2LN10Ast__pat_tN10Ast__exp_t v_29 = {0};
            _fx_LN10Ast__pat_t idxp_1 = 0;
            _fx_N10Ast__exp_t idxp_e_0 = 0;
            _fx_LN10Ast__exp_t v_30 = 0;
            _fx_T2N10Ast__pat_tN10Ast__exp_t v_31 = {0};
            _fx_LT2N10Ast__pat_tN10Ast__exp_t v_32 = 0;
            _fx_N10Ast__pat_t v_33 = 0;
            FX_CALL(_fx_cons_LN10Ast__pat_t(idxp_0, 0, true, &v_28), _fx_catch_9);
            _fx_R10Ast__loc_t v_34;
            FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(idxp_0, &v_34, 0), _fx_catch_9);
            FX_CALL(_fx_M6ParserFM9plist2expT2LN10Ast__pat_tN10Ast__exp_t2LN10Ast__pat_tR10Ast__loc_t(v_28, &v_34, &v_29, 0),
               _fx_catch_9);
            FX_COPY_PTR(v_29.t0, &idxp_1);
            FX_COPY_PTR(v_29.t1, &idxp_e_0);
            FX_CALL(_fx_cons_LN10Ast__exp_t(p_e_0, glob_el_3, true, &v_30), _fx_catch_9);
            FX_CALL(_fx_cons_LN10Ast__exp_t(idxp_e_0, v_30, false, &v_30), _fx_catch_9);
            _fx_make_T2N10Ast__pat_tN10Ast__exp_t(p_1, e_1, &v_31);
            FX_CALL(_fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(&v_31, for_cl__1, true, &v_32), _fx_catch_9);
            FX_CALL(_fx_M6ParserFM2hdN10Ast__pat_t1LN10Ast__pat_t(idxp_1, &v_33, 0), _fx_catch_9);
            _fx_make_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(v_30, v_32, v_33, &v_23);

         _fx_catch_9: ;
            if (v_33) {
               _fx_free_N10Ast__pat_t(&v_33);
            }
            if (v_32) {
               _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&v_32);
            }
            _fx_free_T2N10Ast__pat_tN10Ast__exp_t(&v_31);
            if (v_30) {
               _fx_free_LN10Ast__exp_t(&v_30);
            }
            if (idxp_e_0) {
               _fx_free_N10Ast__exp_t(&idxp_e_0);
            }
            if (idxp_1) {
               _fx_free_LN10Ast__pat_t(&idxp_1);
            }
            _fx_free_T2LN10Ast__pat_tN10Ast__exp_t(&v_29);
            if (v_28) {
               _fx_free_LN10Ast__pat_t(&v_28);
            }
         }
         else {
            fx_exn_t v_35 = {0};
            _fx_R10Ast__loc_t v_36;
            FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(idxp_0, &v_36, 0), _fx_catch_10);
            fx_str_t slit_3 = FX_MAKE_STR("@ is used more than once, which does not make sence and is not supported");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&v_36, &slit_3, &v_35), _fx_catch_10);
            FX_THROW(&v_35, true, _fx_catch_10);

         _fx_catch_10: ;
            fx_free_exn(&v_35);
         }
         FX_CHECK_EXN(_fx_catch_11);
         _fx_free_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&__fold_result___1);
         _fx_copy_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&v_23, &__fold_result___1);

      _fx_catch_11: ;
         _fx_free_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&v_23);
         if (p_1) {
            _fx_free_N10Ast__pat_t(&p_1);
         }
         if (p_e_0) {
            _fx_free_N10Ast__exp_t(&p_e_0);
         }
         if (p__0) {
            _fx_free_LN10Ast__pat_t(&p__0);
         }
         _fx_free_T2LN10Ast__pat_tN10Ast__exp_t(&v_22);
         if (v_21) {
            _fx_free_LN10Ast__pat_t(&v_21);
         }
         if (idx_pat_1) {
            _fx_free_N10Ast__pat_t(&idx_pat_1);
         }
         if (for_cl__1) {
            _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&for_cl__1);
         }
         if (glob_el_3) {
            _fx_free_LN10Ast__exp_t(&glob_el_3);
         }
         _fx_free_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&v_20);
         if (e_1) {
            _fx_free_N10Ast__exp_t(&e_1);
         }
         if (idxp_0) {
            _fx_free_N10Ast__pat_t(&idxp_0);
         }
         if (p_0) {
            _fx_free_N10Ast__pat_t(&p_0);
         }
         FX_CHECK_EXN(_fx_catch_12);
      }
      _fx_copy_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&__fold_result___1, &v_16);
      FX_COPY_PTR(v_16.t0, &glob_el_2);
      FX_COPY_PTR(v_16.t1, &for_cl__0);
      FX_COPY_PTR(v_16.t2, &idx_pat_0);
      FX_CALL(_fx_M6ParserFM3revLT2N10Ast__pat_tN10Ast__exp_t1LT2N10Ast__pat_tN10Ast__exp_t(for_cl__0, &v_17, 0), _fx_catch_12);
      _fx_make_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(v_17, idx_pat_0, when_e_1,
         &loc_0, &v_18);
      FX_CALL(
         _fx_cons_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_18, nested_fors_3, false,
            &nested_fors_3), _fx_catch_12);
      _fx_make_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(glob_el_2,
         nested_fors_3, &v_19);
      _fx_free_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
         &__fold_result___0);
      _fx_copy_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_19,
         &__fold_result___0);

   _fx_catch_12: ;
      _fx_free_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_19);
      _fx_free_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_18);
      if (v_17) {
         _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&v_17);
      }
      if (idx_pat_0) {
         _fx_free_N10Ast__pat_t(&idx_pat_0);
      }
      if (for_cl__0) {
         _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&for_cl__0);
      }
      if (glob_el_2) {
         _fx_free_LN10Ast__exp_t(&glob_el_2);
      }
      _fx_free_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&v_16);
      _fx_free_T3LN10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&__fold_result___1);
      if (v_15) {
         _fx_free_N10Ast__pat_t(&v_15);
      }
      if (nested_fors_3) {
         _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(&nested_fors_3);
      }
      if (glob_el_1) {
         _fx_free_LN10Ast__exp_t(&glob_el_1);
      }
      _fx_free_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_14);
      if (when_e_1) {
         _fx_free_Nt6option1N10Ast__exp_t(&when_e_1);
      }
      if (ppe_list_0) {
         _fx_free_LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_t(&ppe_list_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
      &__fold_result___0, &v_0);
   FX_COPY_PTR(v_0.t0, &glob_el_0);
   FX_COPY_PTR(v_0.t1, &nested_fors_2);
   FX_CALL(_fx_M6ParserFM3revLN10Ast__exp_t1LN10Ast__exp_t(glob_el_0, &v_1, 0), _fx_cleanup);
   if (v_1 != 0) {
      if (v_1->tl == 0) {
         FX_COPY_PTR(v_1->hd, &for_iter_exp_0); goto _fx_endmatch_3;
      }
   }
   FX_CALL(_fx_M6ParserFM10make_tupleN10Ast__exp_t2LN10Ast__exp_tR10Ast__loc_t(v_1, &glob_loc_0, &for_iter_exp_0, 0),
      _fx_catch_13);

_fx_catch_13: ;

_fx_endmatch_3: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(vts_0, &vts_1);
   if (vts_1 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_37 = vts_1->tl;
      if (v_37 != 0) {
         if (v_37->hd.t0.tag == 55) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_38 = &vts_1->hd;
            if (v_38->t0.tag == 49) {
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t v_39 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
               _fx_LT2N10Ast__pat_tN10Ast__exp_t cases_0 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_40 = {0};
               _fx_N10Ast__exp_t match_e_0 = 0;
               FX_CALL(
                  _fx_M6ParserFM17parse_match_casesT2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                     vts_0, &v_39, 0), _fx_catch_14);
               FX_COPY_PTR(v_39.t0, &ts_5);
               FX_COPY_PTR(v_39.t1, &cases_0);
               FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_38->t1, &v_40, 0), _fx_catch_14);
               FX_CALL(
                  _fx_M3AstFM8ExpMatchN10Ast__exp_t3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                     for_iter_exp_0, cases_0, &v_40, &match_e_0), _fx_catch_14);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_5, match_e_0, &v_2);

            _fx_catch_14: ;
               if (match_e_0) {
                  _fx_free_N10Ast__exp_t(&match_e_0);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_40);
               if (cases_0) {
                  _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&cases_0);
               }
               if (ts_5) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(&v_39);
               goto _fx_endmatch_4;
            }
         }
      }
   }
   if (vts_1 != 0) {
      if (vts_1->hd.t0.tag == 49) {
         FX_CALL(
            _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(vts_0,
               &v_2, 0), _fx_catch_15);

      _fx_catch_15: ;
         goto _fx_endmatch_4;
      }
   }
   fx_exn_t v_41 = {0};
   fx_str_t slit_4 = FX_MAKE_STR("\'{\' is expected (beginning of for-loop body)");
   FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_0, &slit_4, &v_41, 0), _fx_catch_16);
   FX_THROW(&v_41, true, _fx_catch_16);

_fx_catch_16: ;
   fx_free_exn(&v_41);

_fx_endmatch_4: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_2.t0, &ts_1);
   FX_COPY_PTR(v_2.t1, &body_0);
   int tag_0 = for_make_0->tag;
   bool res_0;
   if (tag_0 == 2) {
      res_0 = true;
   }
   else if (tag_0 == 3) {
      res_0 = true;
   }
   else if (tag_0 == 5) {
      res_0 = true;
   }
   else if (tag_0 == 4) {
      res_0 = true;
   }
   else {
      res_0 = false;
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      _fx_N10Ast__exp_t v_42 = 0;
      _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t __fold_result___2 = {0};
      _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t v_43 = {0};
      _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t pel_i_l_0 = 0;
      _fx_N10Ast__exp_t glob_when_e_0 = 0;
      _fx_N10Ast__exp_t body_1 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_44 = {0};
      FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&_fx_g10Ast__noloc, &v_42), _fx_catch_21);
      _fx_make_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(0, v_42, &_fx_g10Ast__noloc,
         &__fold_result___2);
      _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t lst_2 = nested_fors_2;
      for (; lst_2; lst_2 = lst_2->tl) {
         _fx_LT2N10Ast__pat_tN10Ast__exp_t pe_l_0 = 0;
         _fx_N10Ast__pat_t idxp_2 = 0;
         _fx_Nt6option1N10Ast__exp_t when_e_2 = 0;
         _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t v_45 = {0};
         _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t pel_i_l_1 = 0;
         _fx_N10Ast__exp_t glob_when_e_1 = 0;
         _fx_N10Ast__exp_t glob_when_e_2 = 0;
         _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t v_46 = {0};
         _fx_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t v_47 = {0};
         _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* __pat___2 = &lst_2->hd;
         FX_COPY_PTR(__pat___2->t0, &pe_l_0);
         FX_COPY_PTR(__pat___2->t1, &idxp_2);
         FX_COPY_PTR(__pat___2->t2, &when_e_2);
         _fx_copy_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&__fold_result___2, &v_45);
         FX_COPY_PTR(v_45.t0, &pel_i_l_1);
         FX_COPY_PTR(v_45.t1, &glob_when_e_1);
         _fx_R10Ast__loc_t loc_1 = v_45.t2;
         if ((when_e_2 != 0) + 1 == 1) {
            FX_COPY_PTR(glob_when_e_1, &glob_when_e_2); goto _fx_endmatch_5;
         }
         if (FX_REC_VARIANT_TAG(glob_when_e_1) == 1) {
            if ((when_e_2 != 0) + 1 == 2) {
               FX_COPY_PTR(when_e_2->u.Some, &glob_when_e_2); goto _fx_endmatch_5;
            }
         }
         if ((when_e_2 != 0) + 1 == 2) {
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_48 = {0};
            _fx_R10Ast__loc_t v_49;
            FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(glob_when_e_1, &v_49, 0), _fx_catch_17);
            _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypBool, &v_49, &v_48);
            FX_CALL(
               _fx_M3AstFM9ExpBinaryN10Ast__exp_t4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                  _fx_g18Parser__OpLogicAnd, glob_when_e_1, when_e_2->u.Some, &v_48, &glob_when_e_2), _fx_catch_17);

         _fx_catch_17: ;
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_48);
            goto _fx_endmatch_5;
         }
         FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_18);

      _fx_endmatch_5: ;
         FX_CHECK_EXN(_fx_catch_18);
         _fx_make_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(pe_l_0, idxp_2, &v_46);
         FX_CALL(_fx_cons_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&v_46, pel_i_l_1, false, &pel_i_l_1), _fx_catch_18);
         _fx_make_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(pel_i_l_1, glob_when_e_2, &loc_1,
            &v_47);
         _fx_free_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&__fold_result___2);
         _fx_copy_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&v_47, &__fold_result___2);

      _fx_catch_18: ;
         _fx_free_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&v_47);
         _fx_free_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&v_46);
         if (glob_when_e_2) {
            _fx_free_N10Ast__exp_t(&glob_when_e_2);
         }
         if (glob_when_e_1) {
            _fx_free_N10Ast__exp_t(&glob_when_e_1);
         }
         if (pel_i_l_1) {
            _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&pel_i_l_1);
         }
         _fx_free_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&v_45);
         if (when_e_2) {
            _fx_free_Nt6option1N10Ast__exp_t(&when_e_2);
         }
         if (idxp_2) {
            _fx_free_N10Ast__pat_t(&idxp_2);
         }
         if (pe_l_0) {
            _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&pe_l_0);
         }
         FX_CHECK_EXN(_fx_catch_21);
      }
      _fx_copy_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&__fold_result___2, &v_43);
      FX_COPY_PTR(v_43.t0, &pel_i_l_0);
      FX_COPY_PTR(v_43.t1, &glob_when_e_0);
      _fx_R10Ast__loc_t loc_2 = v_43.t2;
      if (FX_REC_VARIANT_TAG(glob_when_e_0) == 1) {
         FX_COPY_PTR(body_0, &body_1);
      }
      else {
         _fx_N10Ast__exp_t v_50 = 0;
         _fx_N10Ast__exp_t v_51 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_52 = {0};
         _fx_N10Ast__exp_t check_e_0 = 0;
         _fx_LN10Ast__exp_t v_53 = 0;
         int tag_1 = for_make_0->tag;
         bool res_1;
         if (tag_1 == 2) {
            res_1 = true;
         }
         else if (tag_1 == 5) {
            res_1 = true;
         }
         else {
            res_1 = false;
         }
         FX_CHECK_EXN(_fx_catch_20);
         if (res_1) {
            fx_exn_t v_54 = {0};
            fx_str_t slit_5 = FX_MAKE_STR("\'when\' cannot be used inside array or tuple comprehensions");
            FX_CALL(_fx_M6ParserFM9parse_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_1, &slit_5, &v_54, 0), _fx_catch_19);
            FX_THROW(&v_54, true, _fx_catch_19);

         _fx_catch_19: ;
            fx_free_exn(&v_54);
            goto _fx_endmatch_6;
         }

      _fx_endmatch_6: ;
         FX_CHECK_EXN(_fx_catch_20);
         _fx_R10Ast__loc_t loc_3;
         FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(glob_when_e_0, &loc_3, 0), _fx_catch_20);
         FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&loc_3, &v_50), _fx_catch_20);
         FX_CALL(_fx_M3AstFM11ExpContinueN10Ast__exp_t1RM5loc_t(&loc_3, &v_51), _fx_catch_20);
         _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypVoid, &loc_3, &v_52);
         FX_CALL(
            _fx_M3AstFM5ExpIfN10Ast__exp_t4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(glob_when_e_0, v_50,
               v_51, &v_52, &check_e_0), _fx_catch_20);
         FX_CALL(_fx_cons_LN10Ast__exp_t(body_0, 0, true, &v_53), _fx_catch_20);
         FX_CALL(_fx_cons_LN10Ast__exp_t(check_e_0, v_53, false, &v_53), _fx_catch_20);
         FX_CALL(_fx_M6ParserFM10expseq2expN10Ast__exp_t2LN10Ast__exp_tR10Ast__loc_t(v_53, &loc_3, &body_1, 0), _fx_catch_20);

      _fx_catch_20: ;
         if (v_53) {
            _fx_free_LN10Ast__exp_t(&v_53);
         }
         if (check_e_0) {
            _fx_free_N10Ast__exp_t(&check_e_0);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_52);
         if (v_51) {
            _fx_free_N10Ast__exp_t(&v_51);
         }
         if (v_50) {
            _fx_free_N10Ast__exp_t(&v_50);
         }
      }
      FX_CHECK_EXN(_fx_catch_21);
      _fx_R16Ast__for_flags_t v_55;
      FX_CALL(_fx_M3AstFM17default_for_flagsRM11for_flags_t0(&v_55, 0), _fx_catch_21);
      _fx_R16Ast__for_flags_t v_56 = { is_parallel_0, *for_make_0, need_unzip_0, v_55.for_flag_fold, v_55.for_flag_nested };
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&loc_2, &v_44, 0), _fx_catch_21);
      FX_CALL(
         _fx_M3AstFM6ExpMapN10Ast__exp_t4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tRM11for_flags_tT2N10Ast__typ_tRM5loc_t(
            pel_i_l_0, body_1, &v_56, &v_44, &for_exp_0), _fx_catch_21);

   _fx_catch_21: ;
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_44);
      if (body_1) {
         _fx_free_N10Ast__exp_t(&body_1);
      }
      if (glob_when_e_0) {
         _fx_free_N10Ast__exp_t(&glob_when_e_0);
      }
      if (pel_i_l_0) {
         _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&pel_i_l_0);
      }
      _fx_free_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&v_43);
      _fx_free_T3LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&__fold_result___2);
      if (v_42) {
         _fx_free_N10Ast__exp_t(&v_42);
      }
      goto _fx_endmatch_7;
   }
   _fx_N10Ast__exp_t __fold_result___3 = 0;
   int_ nfors_0;
   FX_CALL(
      _fx_M6ParserFM8length1_i1LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(nested_fors_2,
         &nfors_0, 0), _fx_catch_24);
   FX_COPY_PTR(body_0, &__fold_result___3);
   int_ i_0 = 0;
   _fx_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t lst_3 = nested_fors_2;
   for (; lst_3; lst_3 = lst_3->tl, i_0 += 1) {
      _fx_LT2N10Ast__pat_tN10Ast__exp_t pe_l_1 = 0;
      _fx_N10Ast__pat_t idxp_3 = 0;
      _fx_Nt6option1N10Ast__exp_t when_e_3 = 0;
      _fx_N10Ast__exp_t e_2 = 0;
      _fx_N10Ast__exp_t body_2 = 0;
      _fx_N10Ast__exp_t v_57 = 0;
      _fx_T4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t* __pat___3 = &lst_3->hd;
      FX_COPY_PTR(__pat___3->t0, &pe_l_1);
      FX_COPY_PTR(__pat___3->t1, &idxp_3);
      FX_COPY_PTR(__pat___3->t2, &when_e_3);
      _fx_R10Ast__loc_t loc_4 = __pat___3->t3;
      FX_COPY_PTR(__fold_result___3, &e_2);
      bool nested_0 = i_0 < nfors_0 - 1;
      _fx_R16Ast__for_flags_t flags_0;
      FX_CALL(_fx_M3AstFM17default_for_flagsRM11for_flags_t0(&flags_0, 0), _fx_catch_23);
      _fx_R16Ast__for_flags_t flags_1;
      if (nested_0) {
         _fx_R16Ast__for_flags_t rec_0 =
            { flags_0.for_flag_parallel, flags_0.for_flag_make, flags_0.for_flag_unzip, flags_0.for_flag_fold, true };
         flags_1 = rec_0;
      }
      else {
         _fx_R16Ast__for_flags_t rec_1 =
            { is_parallel_0, flags_0.for_flag_make, need_unzip_0, flags_0.for_flag_fold, flags_0.for_flag_nested };
         flags_1 = rec_1;
      }
      if ((when_e_3 != 0) + 1 == 2) {
         _fx_N10Ast__exp_t v_58 = 0;
         _fx_N10Ast__exp_t v_59 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_60 = {0};
         _fx_N10Ast__exp_t check_e_1 = 0;
         _fx_LN10Ast__exp_t v_61 = 0;
         _fx_N10Ast__exp_t when_e_4 = when_e_3->u.Some;
         _fx_R10Ast__loc_t loc_5;
         FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(when_e_4, &loc_5, 0), _fx_catch_22);
         FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&loc_5, &v_58), _fx_catch_22);
         FX_CALL(_fx_M3AstFM11ExpContinueN10Ast__exp_t1RM5loc_t(&loc_5, &v_59), _fx_catch_22);
         _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g15Parser__TypVoid, &loc_5, &v_60);
         FX_CALL(
            _fx_M3AstFM5ExpIfN10Ast__exp_t4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(when_e_4, v_58, v_59,
               &v_60, &check_e_1), _fx_catch_22);
         FX_CALL(_fx_cons_LN10Ast__exp_t(e_2, 0, true, &v_61), _fx_catch_22);
         FX_CALL(_fx_cons_LN10Ast__exp_t(check_e_1, v_61, false, &v_61), _fx_catch_22);
         FX_CALL(_fx_M6ParserFM10expseq2expN10Ast__exp_t2LN10Ast__exp_tR10Ast__loc_t(v_61, &loc_5, &body_2, 0), _fx_catch_22);

      _fx_catch_22: ;
         if (v_61) {
            _fx_free_LN10Ast__exp_t(&v_61);
         }
         if (check_e_1) {
            _fx_free_N10Ast__exp_t(&check_e_1);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_60);
         if (v_59) {
            _fx_free_N10Ast__exp_t(&v_59);
         }
         if (v_58) {
            _fx_free_N10Ast__exp_t(&v_58);
         }
      }
      else {
         FX_COPY_PTR(e_2, &body_2);
      }
      FX_CHECK_EXN(_fx_catch_23);
      FX_CALL(
         _fx_M3AstFM6ExpForN10Ast__exp_t5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tRM11for_flags_tRM5loc_t(pe_l_1,
            idxp_3, body_2, &flags_1, &loc_4, &v_57), _fx_catch_23);
      _fx_free_N10Ast__exp_t(&__fold_result___3);
      FX_COPY_PTR(v_57, &__fold_result___3);

   _fx_catch_23: ;
      if (v_57) {
         _fx_free_N10Ast__exp_t(&v_57);
      }
      if (body_2) {
         _fx_free_N10Ast__exp_t(&body_2);
      }
      if (e_2) {
         _fx_free_N10Ast__exp_t(&e_2);
      }
      if (when_e_3) {
         _fx_free_Nt6option1N10Ast__exp_t(&when_e_3);
      }
      if (idxp_3) {
         _fx_free_N10Ast__pat_t(&idxp_3);
      }
      if (pe_l_1) {
         _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&pe_l_1);
      }
      FX_CHECK_EXN(_fx_catch_24);
   }
   FX_COPY_PTR(__fold_result___3, &for_exp_0);

_fx_catch_24: ;
   if (__fold_result___3) {
      _fx_free_N10Ast__exp_t(&__fold_result___3);
   }

_fx_endmatch_7: ;
   FX_CHECK_EXN(_fx_cleanup);
   _fx_make_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(ts_1, for_exp_0, for_iter_exp_0, fx_result);

_fx_cleanup: ;
   if (nested_fors_0) {
      _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&nested_fors_0);
   }
   if (vts_0) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
   }
   if (nested_fors_1) {
      _fx_free_LT3LT3N10Ast__pat_tN10Ast__pat_tN10Ast__exp_tNt6option1N10Ast__exp_tR10Ast__loc_t(&nested_fors_1);
   }
   _fx_free_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(
      &__fold_result___0);
   _fx_free_T2LN10Ast__exp_tLT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(&v_0);
   if (glob_el_0) {
      _fx_free_LN10Ast__exp_t(&glob_el_0);
   }
   if (nested_fors_2) {
      _fx_free_LT4LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tNt6option1N10Ast__exp_tR10Ast__loc_t(&nested_fors_2);
   }
   if (v_1) {
      _fx_free_LN10Ast__exp_t(&v_1);
   }
   if (for_iter_exp_0) {
      _fx_free_N10Ast__exp_t(&for_iter_exp_0);
   }
   if (vts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_1);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_2);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (body_0) {
      _fx_free_N10Ast__exp_t(&body_0);
   }
   if (for_exp_0) {
      _fx_free_N10Ast__exp_t(&for_exp_0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM16parse_fold_init_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__pat_tLN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LN10Ast__pat_t_data_t* pl_0,
   struct _fx_LN10Ast__exp_t_data_t* el_0,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t result_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__pat_t pl_1 = 0;
   _fx_LN10Ast__exp_t el_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(pl_0, &pl_1);
   FX_COPY_PTR(el_0, &el_1);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LN10Ast__pat_t pl_2 = 0;
      _fx_LN10Ast__exp_t el_2 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(pl_1, &pl_2);
      FX_COPY_PTR(el_1, &el_2);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               _fx_free_LN10Ast__pat_t(&pl_1);
               FX_COPY_PTR(pl_2, &pl_1);
               _fx_free_LN10Ast__exp_t(&el_1);
               FX_COPY_PTR(el_2, &el_1);
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_2;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 19) {
            _fx_LN10Ast__pat_t __fold_result___0 = 0;
            _fx_LN10Ast__pat_t pl_3 = 0;
            _fx_LN10Ast__exp_t __fold_result___1 = 0;
            _fx_LN10Ast__exp_t el_3 = 0;
            _fx_LN10Ast__pat_t lst_0 = pl_2;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_LN10Ast__pat_t r_0 = 0;
               _fx_N10Ast__pat_t a_0 = lst_0->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LN10Ast__pat_t(a_0, r_0, false, &r_0), _fx_catch_1);
               _fx_free_LN10Ast__pat_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_1: ;
               if (r_0) {
                  _fx_free_LN10Ast__pat_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_5);
            }
            FX_COPY_PTR(__fold_result___0, &pl_3);
            _fx_LN10Ast__exp_t lst_1 = el_2;
            for (; lst_1; lst_1 = lst_1->tl) {
               _fx_LN10Ast__exp_t r_1 = 0;
               _fx_N10Ast__exp_t a_1 = lst_1->hd;
               FX_COPY_PTR(__fold_result___1, &r_1);
               FX_CALL(_fx_cons_LN10Ast__exp_t(a_1, r_1, false, &r_1), _fx_catch_2);
               _fx_free_LN10Ast__exp_t(&__fold_result___1);
               FX_COPY_PTR(r_1, &__fold_result___1);

            _fx_catch_2: ;
               if (r_1) {
                  _fx_free_LN10Ast__exp_t(&r_1);
               }
               FX_CHECK_EXN(_fx_catch_5);
            }
            FX_COPY_PTR(__fold_result___1, &el_3);
            if (el_3 != 0) {
               if (el_3->tl == 0) {
                  if (pl_3 != 0) {
                     if (pl_3->tl == 0) {
                        _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t result_1 = {0};
                        _fx_make_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(ts_2, pl_3->hd, el_3->hd,
                           &result_1);
                        _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&result_0);
                        _fx_copy_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&result_1, &result_0);
                        FX_BREAK(_fx_catch_3);

                     _fx_catch_3: ;
                        _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&result_1);
                        goto _fx_endmatch_0;
                     }
                  }
               }
            }
            _fx_N10Ast__pat_t v_1 = 0;
            _fx_N10Ast__pat_t v_2 = 0;
            _fx_N10Ast__exp_t v_3 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_4 = {0};
            _fx_N10Ast__exp_t v_5 = 0;
            _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t result_2 = {0};
            if (pl_3 != 0) {
               FX_COPY_PTR(pl_3->hd, &v_1);
            }
            else {
               FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_4);
            }
            FX_CHECK_EXN(_fx_catch_4);
            _fx_R10Ast__loc_t v_6;
            FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(v_1, &v_6, 0), _fx_catch_4);
            FX_CALL(_fx_M3AstFM8PatTupleN10Ast__pat_t2LN10Ast__pat_tRM5loc_t(pl_3, &v_6, &v_2), _fx_catch_4);
            if (el_3 != 0) {
               FX_COPY_PTR(el_3->hd, &v_3);
            }
            else {
               FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_4);
            }
            FX_CHECK_EXN(_fx_catch_4);
            _fx_R10Ast__loc_t v_7;
            FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(v_3, &v_7, 0), _fx_catch_4);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_7, &v_4, 0), _fx_catch_4);
            FX_CALL(_fx_M3AstFM10ExpMkTupleN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(el_3, &v_4, &v_5), _fx_catch_4);
            _fx_make_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(ts_2, v_2, v_5, &result_2);
            _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&result_0);
            _fx_copy_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&result_2, &result_0);
            FX_BREAK(_fx_catch_4);

         _fx_catch_4: ;
            _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&result_2);
            if (v_5) {
               _fx_free_N10Ast__exp_t(&v_5);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_4);
            if (v_3) {
               _fx_free_N10Ast__exp_t(&v_3);
            }
            if (v_2) {
               _fx_free_N10Ast__pat_t(&v_2);
            }
            if (v_1) {
               _fx_free_N10Ast__pat_t(&v_1);
            }

         _fx_endmatch_0: ;
            FX_CHECK_EXN(_fx_catch_5);

         _fx_catch_5: ;
            if (el_3) {
               _fx_free_LN10Ast__exp_t(&el_3);
            }
            if (__fold_result___1) {
               _fx_free_LN10Ast__exp_t(&__fold_result___1);
            }
            if (pl_3) {
               _fx_free_LN10Ast__pat_t(&pl_3);
            }
            if (__fold_result___0) {
               _fx_free_LN10Ast__pat_t(&__fold_result___0);
            }
            goto _fx_endmatch_2;
         }
      }
      fx_exn_t v_8 = {0};
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_9 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
      _fx_N10Ast__pat_t p_0 = 0;
      if (expect_comma_2) {
         _fx_R10Ast__loc_t loc_1;
         if (ts_2 != 0) {
            loc_1 = ts_2->hd.t1;
         }
         else {
            loc_1 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_8);
         fx_str_t slit_1 = FX_MAKE_STR("missing \',\'?");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_8), _fx_catch_8);
         FX_THROW(&v_8, true, _fx_catch_8);
      }
      FX_CALL(
         _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_2, true,
            &v_9, 0), _fx_catch_8);
      FX_COPY_PTR(v_9.t0, &ts_3);
      FX_COPY_PTR(v_9.t1, &p_0);
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 86) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_10 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
            _fx_N10Ast__exp_t e_0 = 0;
            _fx_LN10Ast__pat_t v_11 = 0;
            _fx_LN10Ast__exp_t v_12 = 0;
            FX_CALL(
               _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                  ts_3->tl, &v_10, 0), _fx_catch_6);
            FX_COPY_PTR(v_10.t0, &ts_4);
            FX_COPY_PTR(v_10.t1, &e_0);
            FX_CALL(_fx_cons_LN10Ast__pat_t(p_0, pl_2, true, &v_11), _fx_catch_6);
            FX_CALL(_fx_cons_LN10Ast__exp_t(e_0, el_2, true, &v_12), _fx_catch_6);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_4, &ts_1);
            expect_comma_1 = true;
            _fx_free_LN10Ast__pat_t(&pl_1);
            FX_COPY_PTR(v_11, &pl_1);
            _fx_free_LN10Ast__exp_t(&el_1);
            FX_COPY_PTR(v_12, &el_1);

         _fx_catch_6: ;
            if (v_12) {
               _fx_free_LN10Ast__exp_t(&v_12);
            }
            if (v_11) {
               _fx_free_LN10Ast__pat_t(&v_11);
            }
            if (e_0) {
               _fx_free_N10Ast__exp_t(&e_0);
            }
            if (ts_4) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_10);
            goto _fx_endmatch_1;
         }
      }
      fx_exn_t v_13 = {0};
      _fx_R10Ast__loc_t loc_2;
      if (ts_3 != 0) {
         loc_2 = ts_3->hd.t1;
      }
      else {
         loc_2 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_7);
      fx_str_t slit_2 = FX_MAKE_STR("\'=\' is expected");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_13), _fx_catch_7);
      FX_THROW(&v_13, true, _fx_catch_7);

   _fx_catch_7: ;
      fx_free_exn(&v_13);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_8);

   _fx_catch_8: ;
      if (p_0) {
         _fx_free_N10Ast__pat_t(&p_0);
      }
      if (ts_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_9);
      fx_free_exn(&v_8);

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_9);

   _fx_catch_9: ;
      if (el_2) {
         _fx_free_LN10Ast__exp_t(&el_2);
      }
      if (pl_2) {
         _fx_free_LN10Ast__pat_t(&pl_2);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&result_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (pl_1) {
      _fx_free_LN10Ast__pat_t(&pl_1);
   }
   if (el_1) {
      _fx_free_LN10Ast__exp_t(&el_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM13parse_defvalsT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tB v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tB v_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
   _fx_R16Ast__val_flags_t v_2 = {0};
   _fx_R16Ast__val_flags_t flags_0 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 31) {
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0->tl, true, &v_0); goto _fx_endmatch_0;
      }
   }
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0, false, &v_0);

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   bool is_private_0 = v_0.t1;
   if (ts_1 != 0) {
      if (ts_1->hd.t0.tag == 38) {
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tB(ts_1->tl, false, &v_1); goto _fx_endmatch_1;
      }
   }
   if (ts_1 != 0) {
      if (ts_1->hd.t0.tag == 39) {
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tB(ts_1->tl, true, &v_1); goto _fx_endmatch_1;
      }
   }
   fx_exn_t v_3 = {0};
   _fx_R10Ast__loc_t loc_0;
   if (ts_1 != 0) {
      loc_0 = ts_1->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_0);
   fx_str_t slit_0 = FX_MAKE_STR("\'val\' or \'var\' is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_3), _fx_catch_0);
   FX_THROW(&v_3, true, _fx_catch_0);

_fx_catch_0: ;
   fx_free_exn(&v_3);

_fx_endmatch_1: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_1.t0, &ts_2);
   bool is_mutable_0 = v_1.t1;
   FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_2, 0), _fx_cleanup);
   _fx_make_R16Ast__val_flags_t(v_2.val_flag_arg, is_mutable_0, v_2.val_flag_temp, v_2.val_flag_tempref, is_private_0,
      v_2.val_flag_subarray, v_2.val_flag_instance, &v_2.val_flag_method, v_2.val_flag_ctor, v_2.val_flag_global, &flags_0);
   if (ts_2 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_4 = &ts_2->hd;
      if (v_4->t0.tag == 18) {
         _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t v_5 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N10Ast__pat_t p_0 = 0;
         _fx_N10Ast__exp_t e_0 = 0;
         _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t v_6 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_N10Ast__exp_t for_exp_0 = 0;
         _fx_N10Ast__exp_t for_iter_exp_0 = 0;
         _fx_N10Ast__exp_t fold_exp_0 = 0;
         _fx_N10Ast__exp_t v_7 = 0;
         _fx_LN10Ast__exp_t v_8 = 0;
         FX_CALL(
            _fx_M6ParserFM16parse_fold_init_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__pat_tLN10Ast__exp_t(
               ts_2->tl, false, 0, 0, &v_5, 0), _fx_catch_1);
         FX_COPY_PTR(v_5.t0, &ts_3);
         FX_COPY_PTR(v_5.t1, &p_0);
         FX_COPY_PTR(v_5.t2, &e_0);
         FX_CALL(
            _fx_M6ParserFM9parse_forT3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN15Ast__for_make_t(
               ts_3, &_fx_g19Parser__ForMakeNone, &v_6, 0), _fx_catch_1);
         FX_COPY_PTR(v_6.t0, &ts_4);
         FX_COPY_PTR(v_6.t1, &for_exp_0);
         FX_COPY_PTR(v_6.t2, &for_iter_exp_0);
         fx_str_t slit_1 = FX_MAKE_STR("");
         FX_CALL(
            _fx_M6ParserFM18transform_fold_expN10Ast__exp_t6SN10Ast__pat_tN10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
               &slit_1, p_0, e_0, for_exp_0, for_iter_exp_0, &v_4->t1, &fold_exp_0, 0), _fx_catch_1);
         _fx_R10Ast__loc_t v_9;
         FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(p_0, &v_9, 0), _fx_catch_1);
         FX_CALL(
            _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(p_0, fold_exp_0, &flags_0, &v_9,
               &v_7), _fx_catch_1);
         FX_CALL(_fx_cons_LN10Ast__exp_t(v_7, 0, true, &v_8), _fx_catch_1);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(ts_4, v_8, fx_result);

      _fx_catch_1: ;
         if (v_8) {
            _fx_free_LN10Ast__exp_t(&v_8);
         }
         if (v_7) {
            _fx_free_N10Ast__exp_t(&v_7);
         }
         if (fold_exp_0) {
            _fx_free_N10Ast__exp_t(&fold_exp_0);
         }
         if (for_iter_exp_0) {
            _fx_free_N10Ast__exp_t(&for_iter_exp_0);
         }
         if (for_exp_0) {
            _fx_free_N10Ast__exp_t(&for_exp_0);
         }
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(&v_6);
         if (e_0) {
            _fx_free_N10Ast__exp_t(&e_0);
         }
         if (p_0) {
            _fx_free_N10Ast__pat_t(&p_0);
         }
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&v_5);
         goto _fx_endmatch_2;
      }
   }
   FX_CALL(
      _fx_M6ParserFM15extend_defvals_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tR16Ast__val_flags_t(
         ts_2, false, 0, &flags_0, fx_result, 0), _fx_catch_2);

_fx_catch_2: ;

_fx_endmatch_2: ;

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tB(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tB(&v_1);
   if (ts_2) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
   }
   _fx_free_R16Ast__val_flags_t(&v_2);
   _fx_free_R16Ast__val_flags_t(&flags_0);
   return fx_status;
}

static int
   _fx_M6ParserFM15extend_defvals_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tR16Ast__val_flags_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LN10Ast__exp_t_data_t* result_0,
   struct _fx_R16Ast__val_flags_t* flags_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__exp_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LN10Ast__exp_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(result_2, &result_3);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               _fx_free_LN10Ast__exp_t(&result_2);
               FX_COPY_PTR(result_3, &result_2);
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_2;
         }
      }
      bool res_0;
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_1 = &ts_2->hd.t0;
         if (v_1->tag == 2) {
            if (v_1->u.IDENT.t0 == true) {
               res_0 = true; goto _fx_endmatch_0;
            }
         }
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_2 = &ts_2->hd.t0;
         if (v_2->tag == 44) {
            if (v_2->u.LPAREN == true) {
               res_0 = true; goto _fx_endmatch_0;
            }
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 49) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_3 = &ts_2->hd.t0;
         if (v_3->tag == 33) {
            if (v_3->u.REF == true) {
               res_0 = true; goto _fx_endmatch_0;
            }
         }
      }
      res_0 = false;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_9);
      if (res_0) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t result_4 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_4 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N10Ast__pat_t p_0 = 0;
         if (expect_comma_2) {
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(ts_2, result_3, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_4, &result_1);
            FX_BREAK(_fx_catch_7);
         }
         else {
            FX_CALL(
               _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_2,
                  true, &v_4, 0), _fx_catch_7);
            FX_COPY_PTR(v_4.t0, &ts_3);
            FX_COPY_PTR(v_4.t1, &p_0);
            if (ts_3 != 0) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_5 = ts_3->tl;
               if (v_5 != 0) {
                  if (v_5->hd.t0.tag == 9) {
                     _fx_T2N14Lexer__token_tR10Ast__loc_t* v_6 = &ts_3->hd;
                     if (v_6->t0.tag == 86) {
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t v_7 = 0;
                        _fx_N10Ast__typ_t v_8 = 0;
                        _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_9 = {0};
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
                        _fx_N10Ast__exp_t e_0 = 0;
                        _fx_N10Ast__exp_t dv_0 = 0;
                        _fx_LN10Ast__exp_t v_10 = 0;
                        if (ts_3 != 0) {
                           FX_COPY_PTR(ts_3->tl, &v_7);
                        }
                        else {
                           FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_1);
                        }
                        FX_CHECK_EXN(_fx_catch_1);
                        FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_8, 0), _fx_catch_1);
                        FX_CALL(
                           _fx_M6ParserFM15parse_ccode_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
                              v_7, v_8, &v_9, 0), _fx_catch_1);
                        FX_COPY_PTR(v_9.t0, &ts_4);
                        FX_COPY_PTR(v_9.t1, &e_0);
                        FX_CALL(
                           _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(p_0, e_0, flags_0,
                              &v_6->t1, &dv_0), _fx_catch_1);
                        FX_CALL(_fx_cons_LN10Ast__exp_t(dv_0, result_3, true, &v_10), _fx_catch_1);
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                        FX_COPY_PTR(ts_4, &ts_1);
                        expect_comma_1 = true;
                        _fx_free_LN10Ast__exp_t(&result_2);
                        FX_COPY_PTR(v_10, &result_2);

                     _fx_catch_1: ;
                        if (v_10) {
                           _fx_free_LN10Ast__exp_t(&v_10);
                        }
                        if (dv_0) {
                           _fx_free_N10Ast__exp_t(&dv_0);
                        }
                        if (e_0) {
                           _fx_free_N10Ast__exp_t(&e_0);
                        }
                        if (ts_4) {
                           _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
                        }
                        _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_9);
                        if (v_8) {
                           _fx_free_N10Ast__typ_t(&v_8);
                        }
                        if (v_7) {
                           _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_7);
                        }
                        goto _fx_endmatch_1;
                     }
                  }
               }
            }
            if (ts_3 != 0) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_11 = ts_3->tl;
               if (v_11 != 0) {
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t v_12 = v_11->tl;
                  if (v_12 != 0) {
                     _fx_N14Lexer__token_t* v_13 = &v_12->hd.t0;
                     if (v_13->tag == 1) {
                        _fx_N10Ast__lit_t* v_14 = &v_13->u.LITERAL;
                        if (v_14->tag == 5) {
                           _fx_T2N14Lexer__token_tR10Ast__loc_t* v_15 = &v_11->hd;
                           _fx_N14Lexer__token_t* v_16 = &v_15->t0;
                           if (v_16->tag == 13) {
                              _fx_T2N14Lexer__token_tR10Ast__loc_t* v_17 = &ts_3->hd;
                              if (v_17->t0.tag == 86) {
                                 fx_str_t fname_0 = {0};
                                 fx_exn_t exn_0 = {0};
                                 _fx_T2N10Ast__typ_tR10Ast__loc_t v_18 = {0};
                                 _fx_N10Ast__exp_t e_1 = 0;
                                 _fx_N10Ast__exp_t dv_1 = 0;
                                 _fx_LN10Ast__exp_t v_19 = 0;
                                 _fx_R10Ast__loc_t* l1_0 = &v_17->t1;
                                 fx_str_t* fname_1 = &v_14->u.LitString;
                                 _fx_LS v_20 = 0;
                                 FX_COPY_PTR(_fx_g18Parser__parser_ctx.inc_dirs, &v_20);
                                 FX_CALL(_fx_M8FilenameFM6locateS2SLS(fname_1, v_20, &fname_0, 0), _fx_catch_2);

                              _fx_catch_2: ;
                                 if (v_20) {
                                    _fx_free_LS(&v_20);
                                 }
                                 if (fx_status < 0) {
                                    fx_exn_get_and_reset(fx_status, &exn_0);
                                    fx_status = 0;
                                    FX_FREE_STR(&fname_0);
                                    if (exn_0.tag == FX_EXN_NotFoundError) {
                                       fx_str_t v_21 = {0};
                                       fx_exn_t v_22 = {0};
                                       fx_str_t slit_1 = FX_MAKE_STR("file ");
                                       fx_str_t slit_2 = FX_MAKE_STR(" is not found");
                                       {
                                          const fx_str_t strs_0[] = { slit_1, *fname_1, slit_2 };
                                          FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_21), _fx_catch_3);
                                       }
                                       FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&v_15->t1, &v_21, &v_22),
                                          _fx_catch_3);
                                       FX_THROW(&v_22, true, _fx_catch_3);

                                    _fx_catch_3: ;
                                       fx_free_exn(&v_22);
                                       FX_FREE_STR(&v_21);
                                    }
                                    else {
                                       FX_RETHROW(&exn_0, _fx_catch_4);
                                    }
                                    FX_CHECK_EXN(_fx_catch_4);
                                 }
                                 FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(l1_0, &v_18, 0),
                                    _fx_catch_4);
                                 FX_CALL(
                                    _fx_M3AstFM7ExpDataN10Ast__exp_t3SST2N10Ast__typ_tRM5loc_t(&v_16->u.DATA, &fname_0, &v_18,
                                       &e_1), _fx_catch_4);
                                 FX_CALL(
                                    _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(p_0, e_1,
                                       flags_0, l1_0, &dv_1), _fx_catch_4);
                                 FX_CALL(_fx_cons_LN10Ast__exp_t(dv_1, result_3, true, &v_19), _fx_catch_4);
                                 _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &v_12->tl;
                                 _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                                 FX_COPY_PTR(*rest_1, &ts_1);
                                 expect_comma_1 = true;
                                 _fx_free_LN10Ast__exp_t(&result_2);
                                 FX_COPY_PTR(v_19, &result_2);

                              _fx_catch_4: ;
                                 if (v_19) {
                                    _fx_free_LN10Ast__exp_t(&v_19);
                                 }
                                 if (dv_1) {
                                    _fx_free_N10Ast__exp_t(&dv_1);
                                 }
                                 if (e_1) {
                                    _fx_free_N10Ast__exp_t(&e_1);
                                 }
                                 _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_18);
                                 fx_free_exn(&exn_0);
                                 FX_FREE_STR(&fname_0);
                                 goto _fx_endmatch_1;
                              }
                           }
                        }
                     }
                  }
               }
            }
            if (ts_3 != 0) {
               _fx_T2N14Lexer__token_tR10Ast__loc_t* v_23 = &ts_3->hd;
               if (v_23->t0.tag == 86) {
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_24 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
                  _fx_N10Ast__exp_t e_2 = 0;
                  _fx_N10Ast__exp_t dv_2 = 0;
                  _fx_LN10Ast__exp_t v_25 = 0;
                  FX_CALL(
                     _fx_M6ParserFM26parse_complex_exp_or_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                        ts_3->tl, &v_24, 0), _fx_catch_5);
                  FX_COPY_PTR(v_24.t0, &ts_5);
                  FX_COPY_PTR(v_24.t1, &e_2);
                  FX_CALL(
                     _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(p_0, e_2, flags_0,
                        &v_23->t1, &dv_2), _fx_catch_5);
                  FX_CALL(_fx_cons_LN10Ast__exp_t(dv_2, result_3, true, &v_25), _fx_catch_5);
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  FX_COPY_PTR(ts_5, &ts_1);
                  expect_comma_1 = true;
                  _fx_free_LN10Ast__exp_t(&result_2);
                  FX_COPY_PTR(v_25, &result_2);

               _fx_catch_5: ;
                  if (v_25) {
                     _fx_free_LN10Ast__exp_t(&v_25);
                  }
                  if (dv_2) {
                     _fx_free_N10Ast__exp_t(&dv_2);
                  }
                  if (e_2) {
                     _fx_free_N10Ast__exp_t(&e_2);
                  }
                  if (ts_5) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_24);
                  goto _fx_endmatch_1;
               }
            }
            fx_exn_t v_26 = {0};
            _fx_R10Ast__loc_t loc_1;
            if (ts_3 != 0) {
               loc_1 = ts_3->hd.t1;
            }
            else {
               loc_1 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_6);
            fx_str_t slit_3 = FX_MAKE_STR("\'=\' is expected");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_3, &v_26), _fx_catch_6);
            FX_THROW(&v_26, true, _fx_catch_6);

         _fx_catch_6: ;
            fx_free_exn(&v_26);

         _fx_endmatch_1: ;
            FX_CHECK_EXN(_fx_catch_7);
         }

      _fx_catch_7: ;
         if (p_0) {
            _fx_free_N10Ast__pat_t(&p_0);
         }
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_4);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_4);
         goto _fx_endmatch_2;
      }
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t result_5 = {0};
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(ts_2, result_3, &result_5);
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_1);
      _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_5, &result_1);
      FX_BREAK(_fx_catch_8);

   _fx_catch_8: ;
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_5);

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_9);

   _fx_catch_9: ;
      if (result_3) {
         _fx_free_LN10Ast__exp_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LN10Ast__exp_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10get_opnameR9Ast__id_t1N14Lexer__token_t(
   struct _fx_N14Lexer__token_t* t_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = t_0->tag;
   if (tag_0 == 4) {
      FX_CALL(_fx_M3AstFM13fname_op_aposRM4id_t0(fx_result, 0), _fx_catch_0);  _fx_catch_0: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 65) {
      FX_CALL(_fx_M3AstFM12fname_op_addRM4id_t0(fx_result, 0), _fx_catch_1);  _fx_catch_1: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 64) {
      FX_CALL(_fx_M3AstFM12fname_op_subRM4id_t0(fx_result, 0), _fx_catch_2);  _fx_catch_2: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 66) {
      FX_CALL(_fx_M3AstFM12fname_op_mulRM4id_t0(fx_result, 0), _fx_catch_3);  _fx_catch_3: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 58) {
      FX_CALL(_fx_M3AstFM13fname_op_rdivRM4id_t0(fx_result, 0), _fx_catch_4);  _fx_catch_4: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 67) {
      FX_CALL(_fx_M3AstFM12fname_op_divRM4id_t0(fx_result, 0), _fx_catch_5);  _fx_catch_5: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 69) {
      FX_CALL(_fx_M3AstFM12fname_op_modRM4id_t0(fx_result, 0), _fx_catch_6);  _fx_catch_6: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 70) {
      FX_CALL(_fx_M3AstFM12fname_op_powRM4id_t0(fx_result, 0), _fx_catch_7);  _fx_catch_7: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 72) {
      FX_CALL(_fx_M3AstFM16fname_op_dot_addRM4id_t0(fx_result, 0), _fx_catch_8);  _fx_catch_8: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 73) {
      FX_CALL(_fx_M3AstFM16fname_op_dot_subRM4id_t0(fx_result, 0), _fx_catch_9);  _fx_catch_9: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 71) {
      FX_CALL(_fx_M3AstFM16fname_op_dot_mulRM4id_t0(fx_result, 0), _fx_catch_10);  _fx_catch_10: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 74) {
      FX_CALL(_fx_M3AstFM16fname_op_dot_divRM4id_t0(fx_result, 0), _fx_catch_11);  _fx_catch_11: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 75) {
      FX_CALL(_fx_M3AstFM16fname_op_dot_modRM4id_t0(fx_result, 0), _fx_catch_12);  _fx_catch_12: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 76) {
      FX_CALL(_fx_M3AstFM16fname_op_dot_powRM4id_t0(fx_result, 0), _fx_catch_13);  _fx_catch_13: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 78) {
      FX_CALL(_fx_M3AstFM12fname_op_shlRM4id_t0(fx_result, 0), _fx_catch_14);  _fx_catch_14: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 77) {
      FX_CALL(_fx_M3AstFM12fname_op_shrRM4id_t0(fx_result, 0), _fx_catch_15);  _fx_catch_15: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 79) {
      FX_CALL(_fx_M3AstFM16fname_op_bit_andRM4id_t0(fx_result, 0), _fx_catch_16);  _fx_catch_16: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 81) {
      FX_CALL(_fx_M3AstFM15fname_op_bit_orRM4id_t0(fx_result, 0), _fx_catch_17);  _fx_catch_17: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 80) {
      FX_CALL(_fx_M3AstFM16fname_op_bit_xorRM4id_t0(fx_result, 0), _fx_catch_18);  _fx_catch_18: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 82) {
      FX_CALL(_fx_M3AstFM16fname_op_bit_notRM4id_t0(fx_result, 0), _fx_catch_19);  _fx_catch_19: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 1) {
         FX_CALL(_fx_M3AstFM16fname_op_aug_addRM4id_t0(fx_result, 0), _fx_catch_20);  _fx_catch_20: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 2) {
         FX_CALL(_fx_M3AstFM16fname_op_aug_subRM4id_t0(fx_result, 0), _fx_catch_21);  _fx_catch_21: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 3) {
         FX_CALL(_fx_M3AstFM16fname_op_aug_mulRM4id_t0(fx_result, 0), _fx_catch_22);  _fx_catch_22: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 4) {
         FX_CALL(_fx_M3AstFM16fname_op_aug_divRM4id_t0(fx_result, 0), _fx_catch_23);  _fx_catch_23: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 6) {
         FX_CALL(_fx_M3AstFM16fname_op_aug_modRM4id_t0(fx_result, 0), _fx_catch_24);  _fx_catch_24: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 16) {
         FX_CALL(_fx_M3AstFM20fname_op_aug_bit_andRM4id_t0(fx_result, 0), _fx_catch_25);  _fx_catch_25: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 18) {
         FX_CALL(_fx_M3AstFM19fname_op_aug_bit_orRM4id_t0(fx_result, 0), _fx_catch_26);  _fx_catch_26: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 20) {
         FX_CALL(_fx_M3AstFM20fname_op_aug_bit_xorRM4id_t0(fx_result, 0), _fx_catch_27);  _fx_catch_27: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 12) {
         FX_CALL(_fx_M3AstFM20fname_op_aug_dot_mulRM4id_t0(fx_result, 0), _fx_catch_28);  _fx_catch_28: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 13) {
         FX_CALL(_fx_M3AstFM20fname_op_aug_dot_divRM4id_t0(fx_result, 0), _fx_catch_29);  _fx_catch_29: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 14) {
         FX_CALL(_fx_M3AstFM20fname_op_aug_dot_modRM4id_t0(fx_result, 0), _fx_catch_30);  _fx_catch_30: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 8) {
         FX_CALL(_fx_M3AstFM16fname_op_aug_shlRM4id_t0(fx_result, 0), _fx_catch_31);  _fx_catch_31: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 88) {
      if (FX_REC_VARIANT_TAG(t_0->u.AUG_BINOP) == 9) {
         FX_CALL(_fx_M3AstFM16fname_op_aug_shrRM4id_t0(fx_result, 0), _fx_catch_32);  _fx_catch_32: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 89) {
      FX_CALL(_fx_M3AstFM12fname_op_cmpRM4id_t0(fx_result, 0), _fx_catch_33);  _fx_catch_33: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 93) {
      FX_CALL(_fx_M3AstFM13fname_op_sameRM4id_t0(fx_result, 0), _fx_catch_34);  _fx_catch_34: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 90) {
      if (t_0->u.CMP.tag == 1) {
         FX_CALL(_fx_M3AstFM11fname_op_eqRM4id_t0(fx_result, 0), _fx_catch_35);  _fx_catch_35: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 90) {
      if (t_0->u.CMP.tag == 2) {
         FX_CALL(_fx_M3AstFM11fname_op_neRM4id_t0(fx_result, 0), _fx_catch_36);  _fx_catch_36: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 90) {
      if (t_0->u.CMP.tag == 4) {
         FX_CALL(_fx_M3AstFM11fname_op_leRM4id_t0(fx_result, 0), _fx_catch_37);  _fx_catch_37: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 90) {
      if (t_0->u.CMP.tag == 5) {
         FX_CALL(_fx_M3AstFM11fname_op_geRM4id_t0(fx_result, 0), _fx_catch_38);  _fx_catch_38: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 90) {
      if (t_0->u.CMP.tag == 3) {
         FX_CALL(_fx_M3AstFM11fname_op_ltRM4id_t0(fx_result, 0), _fx_catch_39);  _fx_catch_39: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 90) {
      if (t_0->u.CMP.tag == 6) {
         FX_CALL(_fx_M3AstFM11fname_op_gtRM4id_t0(fx_result, 0), _fx_catch_40);  _fx_catch_40: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 91) {
      FX_CALL(_fx_M3AstFM16fname_op_dot_cmpRM4id_t0(fx_result, 0), _fx_catch_41);  _fx_catch_41: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 92) {
      if (t_0->u.DOT_CMP.tag == 1) {
         FX_CALL(_fx_M3AstFM15fname_op_dot_eqRM4id_t0(fx_result, 0), _fx_catch_42);  _fx_catch_42: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 92) {
      if (t_0->u.DOT_CMP.tag == 2) {
         FX_CALL(_fx_M3AstFM15fname_op_dot_neRM4id_t0(fx_result, 0), _fx_catch_43);  _fx_catch_43: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 92) {
      if (t_0->u.DOT_CMP.tag == 4) {
         FX_CALL(_fx_M3AstFM15fname_op_dot_leRM4id_t0(fx_result, 0), _fx_catch_44);  _fx_catch_44: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 92) {
      if (t_0->u.DOT_CMP.tag == 5) {
         FX_CALL(_fx_M3AstFM15fname_op_dot_geRM4id_t0(fx_result, 0), _fx_catch_45);  _fx_catch_45: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 92) {
      if (t_0->u.DOT_CMP.tag == 3) {
         FX_CALL(_fx_M3AstFM15fname_op_dot_ltRM4id_t0(fx_result, 0), _fx_catch_46);  _fx_catch_46: ; goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 92) {
      if (t_0->u.DOT_CMP.tag == 6) {
         FX_CALL(_fx_M3AstFM15fname_op_dot_gtRM4id_t0(fx_result, 0), _fx_catch_47);  _fx_catch_47: ; goto _fx_endmatch_0;
      }
   }
   *fx_result = _fx_g9Ast__noid;

_fx_endmatch_0: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM11parse_defunT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_LT2N14Lexer__token_tR10Ast__loc_t vts_0 = 0;
   _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__pat_t params_0 = 0;
   _fx_N10Ast__typ_t rt_0 = 0;
   _fx_LN10Ast__exp_t prologue_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   bool is_private_0 = false;
   bool is_pure_0 = false;
   bool is_nothrow_0 = false;
   bool is_inline_0 = false;
   FX_COPY_PTR(ts_0, &vts_0);
   _fx_R9Ast__id_t class_id_0 = _fx_g9Ast__noid;
   _fx_R9Ast__id_t fname_0 = _fx_g9Ast__noid;
   _fx_R10Ast__loc_t loc_0 = _fx_g10Ast__noloc;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t vts_1 = 0;
      FX_COPY_PTR(vts_0, &vts_1);
      if (vts_1 != 0) {
         if (vts_1->hd.t0.tag == 31) {
            fx_exn_t v_1 = {0};
            if (is_private_0) {
               _fx_R10Ast__loc_t loc_1;
               if (ts_0 != 0) {
                  loc_1 = ts_0->hd.t1;
               }
               else {
                  loc_1 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("duplicate @private attribute");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_0, &v_1), _fx_catch_0);
               FX_THROW(&v_1, true, _fx_catch_0);
            }
            is_private_0 = true;
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &vts_1->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
            FX_COPY_PTR(*rest_0, &vts_0);

         _fx_catch_0: ;
            fx_free_exn(&v_1);
            goto _fx_endmatch_1;
         }
      }
      if (vts_1 != 0) {
         if (vts_1->hd.t0.tag == 32) {
            fx_exn_t v_2 = {0};
            if (is_pure_0) {
               _fx_R10Ast__loc_t loc_2;
               if (ts_0 != 0) {
                  loc_2 = ts_0->hd.t1;
               }
               else {
                  loc_2 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_1);
               fx_str_t slit_1 = FX_MAKE_STR("duplicate @pure attribute");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_1, &v_2), _fx_catch_1);
               FX_THROW(&v_2, true, _fx_catch_1);
            }
            is_pure_0 = true;
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &vts_1->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
            FX_COPY_PTR(*rest_1, &vts_0);

         _fx_catch_1: ;
            fx_free_exn(&v_2);
            goto _fx_endmatch_1;
         }
      }
      if (vts_1 != 0) {
         if (vts_1->hd.t0.tag == 27) {
            fx_exn_t v_3 = {0};
            if (is_nothrow_0) {
               _fx_R10Ast__loc_t loc_3;
               if (ts_0 != 0) {
                  loc_3 = ts_0->hd.t1;
               }
               else {
                  loc_3 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_2);
               fx_str_t slit_2 = FX_MAKE_STR("duplicate @nothrow attribute");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_2, &v_3), _fx_catch_2);
               FX_THROW(&v_3, true, _fx_catch_2);
            }
            is_nothrow_0 = true;
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_2 = &vts_1->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
            FX_COPY_PTR(*rest_2, &vts_0);

         _fx_catch_2: ;
            fx_free_exn(&v_3);
            goto _fx_endmatch_1;
         }
      }
      if (vts_1 != 0) {
         if (vts_1->hd.t0.tag == 24) {
            fx_exn_t v_4 = {0};
            if (is_inline_0) {
               _fx_R10Ast__loc_t loc_4;
               if (ts_0 != 0) {
                  loc_4 = ts_0->hd.t1;
               }
               else {
                  loc_4 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_3);
               fx_str_t slit_3 = FX_MAKE_STR("duplicate @inline attribute");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_4, &slit_3, &v_4), _fx_catch_3);
               FX_THROW(&v_4, true, _fx_catch_3);
            }
            is_inline_0 = true;
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_3 = &vts_1->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
            FX_COPY_PTR(*rest_3, &vts_0);

         _fx_catch_3: ;
            fx_free_exn(&v_4);
            goto _fx_endmatch_1;
         }
      }
      if (vts_1 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_5 = vts_1->tl;
         if (v_5 != 0) {
            if (v_5->hd.t0.tag == 2) {
               _fx_T2N14Lexer__token_tR10Ast__loc_t* v_6 = &vts_1->hd;
               if (v_6->t0.tag == 21) {
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t v_7 = 0;
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS v_8 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
                  fx_str_t f_0 = {0};
                  fx_str_t v_9 = {0};
                  fx_str_t v_10 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t v_11 = 0;
                  if (vts_0 != 0) {
                     FX_COPY_PTR(vts_0->tl, &v_7);
                  }
                  else {
                     FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_5);
                  }
                  FX_CHECK_EXN(_fx_catch_5);
                  fx_str_t slit_4 = FX_MAKE_STR("");
                  FX_CALL(
                     _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(
                        v_7, false, &slit_4, &v_8, 0), _fx_catch_5);
                  FX_COPY_PTR(v_8.t0, &ts_2);
                  fx_copy_str(&v_8.t1, &f_0);
                  int_ dot_pos_0 = _fx_M6StringFM5rfindi2SC(&f_0, (char_)46, 0);
                  _fx_Ta2R9Ast__id_t v_12;
                  if (dot_pos_0 >= 0) {
                     FX_CALL(fx_substr(&f_0, 0, dot_pos_0, 1, 1, &v_9), _fx_catch_5);
                     _fx_R9Ast__id_t v_13;
                     FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_9, &v_13, 0), _fx_catch_5);
                     FX_CALL(fx_substr(&f_0, dot_pos_0 + 1, 0, 1, 2, &v_10), _fx_catch_5);
                     _fx_R9Ast__id_t v_14;
                     FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_10, &v_14, 0), _fx_catch_5);
                     _fx_Ta2R9Ast__id_t tup_0 = { v_13, v_14 };
                     v_12 = tup_0;
                  }
                  else {
                     _fx_R9Ast__id_t v_15;
                     FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&f_0, &v_15, 0), _fx_catch_5);
                     _fx_Ta2R9Ast__id_t tup_1 = { _fx_g9Ast__noid, v_15 };
                     v_12 = tup_1;
                  }
                  _fx_R9Ast__id_t class_id__0 = v_12.t0;
                  _fx_R9Ast__id_t fname__0 = v_12.t1;
                  if (ts_2 != 0) {
                     if (ts_2->hd.t0.tag == 44) {
                        FX_COPY_PTR(ts_2->tl, &v_11); goto _fx_endmatch_0;
                     }
                  }
                  fx_exn_t v_16 = {0};
                  _fx_R10Ast__loc_t loc_5;
                  if (ts_2 != 0) {
                     loc_5 = ts_2->hd.t1;
                  }
                  else {
                     loc_5 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_4);
                  fx_str_t slit_5 = FX_MAKE_STR("\'(\' is expected after function name");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_5, &slit_5, &v_16), _fx_catch_4);
                  FX_THROW(&v_16, true, _fx_catch_4);

               _fx_catch_4: ;
                  fx_free_exn(&v_16);

               _fx_endmatch_0: ;
                  FX_CHECK_EXN(_fx_catch_5);
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
                  FX_COPY_PTR(v_11, &vts_0);
                  class_id_0 = class_id__0;
                  fname_0 = fname__0;
                  loc_0 = v_6->t1;
                  FX_BREAK(_fx_catch_5);

               _fx_catch_5: ;
                  if (v_11) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_11);
                  }
                  FX_FREE_STR(&v_10);
                  FX_FREE_STR(&v_9);
                  FX_FREE_STR(&f_0);
                  if (ts_2) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&v_8);
                  if (v_7) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_7);
                  }
                  goto _fx_endmatch_1;
               }
            }
         }
      }
      if (vts_1 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_17 = vts_1->tl;
         if (v_17 != 0) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_18 = v_17->tl;
            if (v_18 != 0) {
               if (v_18->hd.t0.tag == 44) {
                  _fx_T2N14Lexer__token_tR10Ast__loc_t* v_19 = &vts_1->hd;
                  if (v_19->t0.tag == 28) {
                     fx_exn_t v_20 = {0};
                     _fx_T2N14Lexer__token_tR10Ast__loc_t* v_21 = &v_17->hd;
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_4 = &v_18->tl;
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
                     FX_COPY_PTR(*rest_4, &vts_0);
                     _fx_R9Ast__id_t v_22;
                     FX_CALL(_fx_M6ParserFM10get_opnameR9Ast__id_t1N14Lexer__token_t(&v_21->t0, &v_22, 0), _fx_catch_6);
                     fname_0 = v_22;
                     loc_0 = v_19->t1;
                     bool res_0;
                     FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&fname_0, &_fx_g9Ast__noid, &res_0, 0), _fx_catch_6);
                     if (res_0) {
                        fx_str_t slit_6 = FX_MAKE_STR("invalid operator name");
                        FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&v_21->t1, &slit_6, &v_20), _fx_catch_6);
                        FX_THROW(&v_20, true, _fx_catch_6);
                     }
                     FX_BREAK(_fx_catch_6);

                  _fx_catch_6: ;
                     fx_free_exn(&v_20);
                     goto _fx_endmatch_1;
                  }
               }
            }
         }
      }
      fx_exn_t v_23 = {0};
      _fx_R10Ast__loc_t loc_6;
      if (vts_0 != 0) {
         loc_6 = vts_0->hd.t1;
      }
      else {
         loc_6 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_7);
      fx_str_t slit_7 = FX_MAKE_STR("\'fun <funcname> (\' is expected (after optional attributes)");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_6, &slit_7, &v_23), _fx_catch_7);
      FX_THROW(&v_23, true, _fx_catch_7);

   _fx_catch_7: ;
      fx_free_exn(&v_23);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_8);

   _fx_catch_8: ;
      if (vts_1) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_1);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_CALL(
      _fx_M6ParserFM16parse_fun_paramsT5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB1LT2N14Lexer__token_tR10Ast__loc_t(
         vts_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &params_0);
   FX_COPY_PTR(v_0.t2, &rt_0);
   FX_COPY_PTR(v_0.t3, &prologue_0);
   bool have_keywords_0 = v_0.t4;
   _fx_R16Ast__fun_flags_t v_24;
   FX_CALL(_fx_M3AstFM17default_fun_flagsRM11fun_flags_t0(&v_24, 0), _fx_cleanup);
   int_ t_0;
   if (is_pure_0) {
      t_0 = 1;
   }
   else {
      t_0 = -1;
   }
   _fx_R16Ast__fun_flags_t v_25 =
      { t_0, v_24.fun_flag_ccode, have_keywords_0, is_inline_0, is_nothrow_0, v_24.fun_flag_really_nothrow, is_private_0,
         v_24.fun_flag_ctor, class_id_0, v_24.fun_flag_uses_fv, v_24.fun_flag_recursive, v_24.fun_flag_instance };
   FX_CALL(
      _fx_M6ParserFM23parse_body_and_make_funT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t7LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tR16Ast__fun_flags_tR10Ast__loc_t(
         ts_1, &fname_0, params_0, rt_0, prologue_0, &v_25, &loc_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   if (vts_0) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
   }
   _fx_free_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (params_0) {
      _fx_free_LN10Ast__pat_t(&params_0);
   }
   if (rt_0) {
      _fx_free_N10Ast__typ_t(&rt_0);
   }
   if (prologue_0) {
      _fx_free_LN10Ast__exp_t(&prologue_0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_0 = &ts_0->hd;
      if (v_0->t0.tag == 22) {
         _fx_R10Ast__loc_t* l1_0 = &v_0->t1;
         FX_CALL(
            _fx_M6ParserFM9parse_if_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_tR10Ast__loc_t(
               ts_0->tl, l1_0, l1_0, fx_result, 0), _fx_catch_0);

      _fx_catch_0: ;
         goto _fx_endmatch_4;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_1 = &ts_0->hd;
      if (v_1->t0.tag == 36) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_2 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
         _fx_N10Ast__exp_t e_0 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_3 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
         _fx_N10Ast__exp_t e_1 = 0;
         _fx_R10Ast__loc_t* l1_1 = &v_1->t1;
         FX_CALL(
            _fx_M6ParserFM18parse_exp_or_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_0->tl, &v_2, 0), _fx_catch_15);
         FX_COPY_PTR(v_2.t0, &ts_1);
         FX_COPY_PTR(v_2.t1, &e_0);
         if (ts_1 != 0) {
            if (ts_1->hd.t0.tag == 8) {
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t v_4 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
               _fx_LT2N10Ast__pat_tN10Ast__exp_t cases_0 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_5 = {0};
               _fx_N10Ast__exp_t v_6 = 0;
               FX_CALL(
                  _fx_M6ParserFM17parse_match_casesT2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                     ts_1->tl, &v_4, 0), _fx_catch_1);
               FX_COPY_PTR(v_4.t0, &ts_3);
               FX_COPY_PTR(v_4.t1, &cases_0);
               FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(l1_1, &v_5, 0), _fx_catch_1);
               FX_CALL(
                  _fx_M3AstFM11ExpTryCatchN10Ast__exp_t3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(e_0,
                     cases_0, &v_5, &v_6), _fx_catch_1);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_3, v_6, &v_3);

            _fx_catch_1: ;
               if (v_6) {
                  _fx_free_N10Ast__exp_t(&v_6);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_5);
               if (cases_0) {
                  _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&cases_0);
               }
               if (ts_3) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(&v_4);
               goto _fx_endmatch_0;
            }
         }
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1, e_0, &v_3);

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_15);
         FX_COPY_PTR(v_3.t0, &ts_2);
         FX_COPY_PTR(v_3.t1, &e_1);
         if (ts_2 != 0) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_7 = &ts_2->hd;
            if (v_7->t0.tag == 17) {
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_8 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
               _fx_N10Ast__exp_t final_e_0 = 0;
               _fx_LR10Ast__loc_t v_9 = 0;
               _fx_N10Ast__pat_t v_10 = 0;
               _fx_R16Ast__val_flags_t v_11 = {0};
               _fx_N10Ast__exp_t def_tmp_0 = 0;
               _fx_LN10Ast__exp_t v_12 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_13 = {0};
               _fx_N10Ast__exp_t v_14 = 0;
               _fx_LN10Ast__exp_t v_15 = 0;
               _fx_LN10Ast__exp_t try_block_0 = 0;
               _fx_N10Ast__exp_t try_block_1 = 0;
               _fx_N10Ast__pat_t some_exn_pat_0 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_16 = {0};
               _fx_N10Ast__exp_t v_17 = 0;
               _fx_N10Ast__exp_t rethrow_exn_0 = 0;
               _fx_N10Ast__exp_t v_18 = 0;
               _fx_LN10Ast__exp_t v_19 = 0;
               _fx_LN10Ast__exp_t v_20 = 0;
               _fx_LN10Ast__exp_t catch_block_0 = 0;
               _fx_N10Ast__exp_t catch_block_1 = 0;
               _fx_T2N10Ast__pat_tN10Ast__exp_t v_21 = {0};
               _fx_LT2N10Ast__pat_tN10Ast__exp_t v_22 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_23 = {0};
               _fx_N10Ast__exp_t try_finally_0 = 0;
               _fx_R10Ast__loc_t* fe_loc_0 = &v_7->t1;
               FX_CALL(
                  _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                     ts_2->tl, &v_8, 0), _fx_catch_14);
               FX_COPY_PTR(v_8.t0, &ts_4);
               FX_COPY_PTR(v_8.t1, &final_e_0);
               FX_CALL(_fx_cons_LR10Ast__loc_t(fe_loc_0, 0, true, &v_9), _fx_catch_14);
               FX_CALL(_fx_cons_LR10Ast__loc_t(l1_1, v_9, false, &v_9), _fx_catch_14);
               _fx_R10Ast__loc_t ll_0;
               FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(v_9, l1_1, &ll_0, 0), _fx_catch_14);
               _fx_R9Ast__id_t tmp_0;
               fx_str_t slit_0 = FX_MAKE_STR("v");
               FX_CALL(_fx_M3AstFM6gen_idRM4id_t2iS(_fx_g18Parser__parser_ctx.m_idx, &slit_0, &tmp_0, 0), _fx_catch_14);
               FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&tmp_0, l1_1, &v_10), _fx_catch_14);
               FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_11, 0), _fx_catch_14);
               FX_CALL(
                  _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(v_10, e_1, &v_11, l1_1,
                     &def_tmp_0), _fx_catch_14);
               int tag_0 = FX_REC_VARIANT_TAG(final_e_0);
               if (tag_0 != 1) {
                  if (tag_0 == 12) {
                     FX_COPY_PTR(final_e_0->u.ExpSeq.t0, &v_12);
                  }
                  else {
                     FX_CALL(_fx_cons_LN10Ast__exp_t(final_e_0, 0, true, &v_12), _fx_catch_2);  _fx_catch_2: ;
                  }
               }
               FX_CHECK_EXN(_fx_catch_14);
               FX_CALL(_fx_cons_LN10Ast__exp_t(def_tmp_0, v_12, false, &v_12), _fx_catch_14);
               FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(l1_1, &v_13, 0), _fx_catch_14);
               FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&tmp_0, &v_13, &v_14), _fx_catch_14);
               FX_CALL(_fx_cons_LN10Ast__exp_t(v_14, 0, true, &v_15), _fx_catch_14);
               if (v_12 == 0) {
                  FX_COPY_PTR(v_15, &try_block_0);
               }
               else if (v_15 == 0) {
                  FX_COPY_PTR(v_12, &try_block_0);
               }
               else {
                  _fx_LN10Ast__exp_t v_24 = 0;
                  _fx_LN10Ast__exp_t lstend_0 = 0;
                  _fx_LN10Ast__exp_t lst_0 = v_12;
                  for (; lst_0; lst_0 = lst_0->tl) {
                     _fx_N10Ast__exp_t x_0 = lst_0->hd;
                     _fx_LN10Ast__exp_t node_0 = 0;
                     FX_CALL(_fx_cons_LN10Ast__exp_t(x_0, 0, false, &node_0), _fx_catch_3);
                     FX_LIST_APPEND(v_24, lstend_0, node_0);

                  _fx_catch_3: ;
                     FX_CHECK_EXN(_fx_catch_4);
                  }
                  _fx_M6ParserFM5link2LN10Ast__exp_t2LN10Ast__exp_tLN10Ast__exp_t(v_24, v_15, &try_block_0, 0);

               _fx_catch_4: ;
                  if (v_24) {
                     _fx_free_LN10Ast__exp_t(&v_24);
                  }
               }
               FX_CHECK_EXN(_fx_catch_14);
               if (try_block_0 == 0) {
                  FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(l1_1, &try_block_1), _fx_catch_5);

               _fx_catch_5: ;
                  goto _fx_endmatch_1;
               }
               if (try_block_0 != 0) {
                  if (try_block_0->tl == 0) {
                     FX_COPY_PTR(try_block_0->hd, &try_block_1); goto _fx_endmatch_1;
                  }
               }
               _fx_LR10Ast__loc_t llist_0 = 0;
               _fx_N10Ast__typ_t v_25 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_26 = {0};
               _fx_LR10Ast__loc_t lstend_1 = 0;
               _fx_LN10Ast__exp_t lst_1 = try_block_0;
               for (; lst_1; lst_1 = lst_1->tl) {
                  _fx_N10Ast__exp_t e_2 = lst_1->hd;
                  _fx_R10Ast__loc_t res_0;
                  FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_2, &res_0, 0), _fx_catch_6);
                  _fx_LR10Ast__loc_t node_1 = 0;
                  FX_CALL(_fx_cons_LR10Ast__loc_t(&res_0, 0, false, &node_1), _fx_catch_6);
                  FX_LIST_APPEND(llist_0, lstend_1, node_1);

               _fx_catch_6: ;
                  FX_CHECK_EXN(_fx_catch_7);
               }
               _fx_R10Ast__loc_t loc_0;
               FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(llist_0, l1_1, &loc_0, 0), _fx_catch_7);
               FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_25, 0), _fx_catch_7);
               _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_25, &loc_0, &v_26);
               FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(try_block_0, &v_26, &try_block_1),
                  _fx_catch_7);

            _fx_catch_7: ;
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_26);
               if (v_25) {
                  _fx_free_N10Ast__typ_t(&v_25);
               }
               FX_FREE_LIST_SIMPLE(&llist_0);

            _fx_endmatch_1: ;
               FX_CHECK_EXN(_fx_catch_14);
               _fx_R9Ast__id_t some_exn_0;
               fx_str_t slit_1 = FX_MAKE_STR("e");
               FX_CALL(_fx_M3AstFM6gen_idRM4id_t2iS(_fx_g18Parser__parser_ctx.m_idx, &slit_1, &some_exn_0, 0), _fx_catch_14);
               FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&some_exn_0, fe_loc_0, &some_exn_pat_0), _fx_catch_14);
               _fx_make_T2N10Ast__typ_tR10Ast__loc_t(_fx_g14Parser__TypExn, fe_loc_0, &v_16);
               FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&some_exn_0, &v_16, &v_17),
                  _fx_catch_14);
               FX_CALL(_fx_M3AstFM8ExpThrowN10Ast__exp_t2N10Ast__exp_tRM5loc_t(v_17, fe_loc_0, &rethrow_exn_0), _fx_catch_14);
               FX_CALL(_fx_M3AstFM7dup_expN10Ast__exp_t1N10Ast__exp_t(final_e_0, &v_18, 0), _fx_catch_14);
               int tag_1 = FX_REC_VARIANT_TAG(v_18);
               if (tag_1 != 1) {
                  if (tag_1 == 12) {
                     FX_COPY_PTR(v_18->u.ExpSeq.t0, &v_19);
                  }
                  else {
                     FX_CALL(_fx_cons_LN10Ast__exp_t(v_18, 0, true, &v_19), _fx_catch_8);  _fx_catch_8: ;
                  }
               }
               FX_CHECK_EXN(_fx_catch_14);
               FX_CALL(_fx_cons_LN10Ast__exp_t(rethrow_exn_0, 0, true, &v_20), _fx_catch_14);
               if (v_19 == 0) {
                  FX_COPY_PTR(v_20, &catch_block_0);
               }
               else if (v_20 == 0) {
                  FX_COPY_PTR(v_19, &catch_block_0);
               }
               else {
                  _fx_LN10Ast__exp_t v_27 = 0;
                  _fx_LN10Ast__exp_t lstend_2 = 0;
                  _fx_LN10Ast__exp_t lst_2 = v_19;
                  for (; lst_2; lst_2 = lst_2->tl) {
                     _fx_N10Ast__exp_t x_1 = lst_2->hd;
                     _fx_LN10Ast__exp_t node_2 = 0;
                     FX_CALL(_fx_cons_LN10Ast__exp_t(x_1, 0, false, &node_2), _fx_catch_9);
                     FX_LIST_APPEND(v_27, lstend_2, node_2);

                  _fx_catch_9: ;
                     FX_CHECK_EXN(_fx_catch_10);
                  }
                  _fx_M6ParserFM5link2LN10Ast__exp_t2LN10Ast__exp_tLN10Ast__exp_t(v_27, v_20, &catch_block_0, 0);

               _fx_catch_10: ;
                  if (v_27) {
                     _fx_free_LN10Ast__exp_t(&v_27);
                  }
               }
               FX_CHECK_EXN(_fx_catch_14);
               if (catch_block_0 == 0) {
                  FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(fe_loc_0, &catch_block_1), _fx_catch_11);

               _fx_catch_11: ;
                  goto _fx_endmatch_2;
               }
               if (catch_block_0 != 0) {
                  if (catch_block_0->tl == 0) {
                     FX_COPY_PTR(catch_block_0->hd, &catch_block_1); goto _fx_endmatch_2;
                  }
               }
               _fx_LR10Ast__loc_t llist_1 = 0;
               _fx_N10Ast__typ_t v_28 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_29 = {0};
               _fx_LR10Ast__loc_t lstend_3 = 0;
               _fx_LN10Ast__exp_t lst_3 = catch_block_0;
               for (; lst_3; lst_3 = lst_3->tl) {
                  _fx_N10Ast__exp_t e_3 = lst_3->hd;
                  _fx_R10Ast__loc_t res_1;
                  FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_3, &res_1, 0), _fx_catch_12);
                  _fx_LR10Ast__loc_t node_3 = 0;
                  FX_CALL(_fx_cons_LR10Ast__loc_t(&res_1, 0, false, &node_3), _fx_catch_12);
                  FX_LIST_APPEND(llist_1, lstend_3, node_3);

               _fx_catch_12: ;
                  FX_CHECK_EXN(_fx_catch_13);
               }
               _fx_R10Ast__loc_t loc_1;
               FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(llist_1, fe_loc_0, &loc_1, 0), _fx_catch_13);
               FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_28, 0), _fx_catch_13);
               _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_28, &loc_1, &v_29);
               FX_CALL(
                  _fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(catch_block_0, &v_29, &catch_block_1),
                  _fx_catch_13);

            _fx_catch_13: ;
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_29);
               if (v_28) {
                  _fx_free_N10Ast__typ_t(&v_28);
               }
               FX_FREE_LIST_SIMPLE(&llist_1);

            _fx_endmatch_2: ;
               FX_CHECK_EXN(_fx_catch_14);
               _fx_make_T2N10Ast__pat_tN10Ast__exp_t(some_exn_pat_0, catch_block_1, &v_21);
               FX_CALL(_fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(&v_21, 0, true, &v_22), _fx_catch_14);
               FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&ll_0, &v_23, 0), _fx_catch_14);
               FX_CALL(
                  _fx_M3AstFM11ExpTryCatchN10Ast__exp_t3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                     try_block_1, v_22, &v_23, &try_finally_0), _fx_catch_14);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_4, try_finally_0, fx_result);

            _fx_catch_14: ;
               if (try_finally_0) {
                  _fx_free_N10Ast__exp_t(&try_finally_0);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_23);
               if (v_22) {
                  _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&v_22);
               }
               _fx_free_T2N10Ast__pat_tN10Ast__exp_t(&v_21);
               if (catch_block_1) {
                  _fx_free_N10Ast__exp_t(&catch_block_1);
               }
               if (catch_block_0) {
                  _fx_free_LN10Ast__exp_t(&catch_block_0);
               }
               if (v_20) {
                  _fx_free_LN10Ast__exp_t(&v_20);
               }
               if (v_19) {
                  _fx_free_LN10Ast__exp_t(&v_19);
               }
               if (v_18) {
                  _fx_free_N10Ast__exp_t(&v_18);
               }
               if (rethrow_exn_0) {
                  _fx_free_N10Ast__exp_t(&rethrow_exn_0);
               }
               if (v_17) {
                  _fx_free_N10Ast__exp_t(&v_17);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_16);
               if (some_exn_pat_0) {
                  _fx_free_N10Ast__pat_t(&some_exn_pat_0);
               }
               if (try_block_1) {
                  _fx_free_N10Ast__exp_t(&try_block_1);
               }
               if (try_block_0) {
                  _fx_free_LN10Ast__exp_t(&try_block_0);
               }
               if (v_15) {
                  _fx_free_LN10Ast__exp_t(&v_15);
               }
               if (v_14) {
                  _fx_free_N10Ast__exp_t(&v_14);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_13);
               if (v_12) {
                  _fx_free_LN10Ast__exp_t(&v_12);
               }
               if (def_tmp_0) {
                  _fx_free_N10Ast__exp_t(&def_tmp_0);
               }
               _fx_free_R16Ast__val_flags_t(&v_11);
               if (v_10) {
                  _fx_free_N10Ast__pat_t(&v_10);
               }
               FX_FREE_LIST_SIMPLE(&v_9);
               if (final_e_0) {
                  _fx_free_N10Ast__exp_t(&final_e_0);
               }
               if (ts_4) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_8);
               goto _fx_endmatch_3;
            }
         }
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, e_1, fx_result);

      _fx_endmatch_3: ;
         FX_CHECK_EXN(_fx_catch_15);

      _fx_catch_15: ;
         if (e_1) {
            _fx_free_N10Ast__exp_t(&e_1);
         }
         if (ts_2) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_3);
         if (e_0) {
            _fx_free_N10Ast__exp_t(&e_0);
         }
         if (ts_1) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_2);
         goto _fx_endmatch_4;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_30 = &ts_0->hd;
      if (v_30->t0.tag == 26) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_31 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
         _fx_N10Ast__exp_t e_4 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t v_32 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
         _fx_LT2N10Ast__pat_tN10Ast__exp_t cases_1 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_33 = {0};
         _fx_N10Ast__exp_t v_34 = 0;
         FX_CALL(
            _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
               ts_0->tl, false, &v_31, 0), _fx_catch_16);
         FX_COPY_PTR(v_31.t0, &ts_5);
         FX_COPY_PTR(v_31.t1, &e_4);
         FX_CALL(
            _fx_M6ParserFM17parse_match_casesT2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_5, &v_32, 0), _fx_catch_16);
         FX_COPY_PTR(v_32.t0, &ts_6);
         FX_COPY_PTR(v_32.t1, &cases_1);
         FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_30->t1, &v_33, 0), _fx_catch_16);
         FX_CALL(
            _fx_M3AstFM8ExpMatchN10Ast__exp_t3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(e_4, cases_1,
               &v_33, &v_34), _fx_catch_16);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_6, v_34, fx_result);

      _fx_catch_16: ;
         if (v_34) {
            _fx_free_N10Ast__exp_t(&v_34);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_33);
         if (cases_1) {
            _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&cases_1);
         }
         if (ts_6) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(&v_32);
         if (e_4) {
            _fx_free_N10Ast__exp_t(&e_4);
         }
         if (ts_5) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_31);
         goto _fx_endmatch_4;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_35 = &ts_0->hd;
      if (v_35->t0.tag == 18) {
         _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t v_36 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_7 = 0;
         _fx_N10Ast__pat_t p_0 = 0;
         _fx_N10Ast__exp_t e_5 = 0;
         _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t v_37 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_8 = 0;
         _fx_N10Ast__exp_t for_exp_0 = 0;
         _fx_N10Ast__exp_t for_iter_exp_0 = 0;
         _fx_N10Ast__exp_t fold_exp_0 = 0;
         FX_CALL(
            _fx_M6ParserFM16parse_fold_init_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__pat_tLN10Ast__exp_t(
               ts_0->tl, false, 0, 0, &v_36, 0), _fx_catch_17);
         FX_COPY_PTR(v_36.t0, &ts_7);
         FX_COPY_PTR(v_36.t1, &p_0);
         FX_COPY_PTR(v_36.t2, &e_5);
         FX_CALL(
            _fx_M6ParserFM9parse_forT3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN15Ast__for_make_t(
               ts_7, &_fx_g19Parser__ForMakeNone, &v_37, 0), _fx_catch_17);
         FX_COPY_PTR(v_37.t0, &ts_8);
         FX_COPY_PTR(v_37.t1, &for_exp_0);
         FX_COPY_PTR(v_37.t2, &for_iter_exp_0);
         fx_str_t slit_2 = FX_MAKE_STR("");
         FX_CALL(
            _fx_M6ParserFM18transform_fold_expN10Ast__exp_t6SN10Ast__pat_tN10Ast__exp_tN10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
               &slit_2, p_0, e_5, for_exp_0, for_iter_exp_0, &v_35->t1, &fold_exp_0, 0), _fx_catch_17);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_8, fold_exp_0, fx_result);

      _fx_catch_17: ;
         if (fold_exp_0) {
            _fx_free_N10Ast__exp_t(&fold_exp_0);
         }
         if (for_iter_exp_0) {
            _fx_free_N10Ast__exp_t(&for_iter_exp_0);
         }
         if (for_exp_0) {
            _fx_free_N10Ast__exp_t(&for_exp_0);
         }
         if (ts_8) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_8);
         }
         _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(&v_37);
         if (e_5) {
            _fx_free_N10Ast__exp_t(&e_5);
         }
         if (p_0) {
            _fx_free_N10Ast__pat_t(&p_0);
         }
         if (ts_7) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_7);
         }
         _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tN10Ast__exp_t(&v_36);
         goto _fx_endmatch_4;
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 21) {
         FX_CALL(
            _fx_M6ParserFM12parse_lambdaT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
               fx_result, 0), _fx_catch_18);

      _fx_catch_18: ;
         goto _fx_endmatch_4;
      }
   }
   FX_CALL(
      _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0, true,
         fx_result, 0), _fx_catch_19);

_fx_catch_19: ;

_fx_endmatch_4: ;

_fx_cleanup: ;
   return fx_status;
}

static int
   _fx_M6ParserFM9parse_if_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R10Ast__loc_t* l1_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t c_0 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
   _fx_N10Ast__exp_t then_e_0 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_2 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
   _fx_N10Ast__exp_t else_e_0 = 0;
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_3 = {0};
   _fx_N10Ast__exp_t v_4 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_0, false,
         &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &c_0);
   FX_CALL(
      _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_1, &v_1,
         0), _fx_cleanup);
   FX_COPY_PTR(v_1.t0, &ts_2);
   FX_COPY_PTR(v_1.t1, &then_e_0);
   if (ts_2 != 0) {
      if (ts_2->hd.t0.tag == 15) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_5 = ts_2->tl;
         if (v_5 != 0) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_6 = &v_5->hd;
            if (v_6->t0.tag == 22) {
               FX_CALL(
                  _fx_M6ParserFM9parse_if_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_tR10Ast__loc_t(
                     v_5->tl, &v_6->t1, l1_0, &v_2, 0), _fx_catch_0);

            _fx_catch_0: ;
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if (ts_2 != 0) {
      if (ts_2->hd.t0.tag == 15) {
         FX_CALL(
            _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_2->tl, &v_2, 0), _fx_catch_1);

      _fx_catch_1: ;
         goto _fx_endmatch_0;
      }
   }
   _fx_N10Ast__exp_t v_7 = 0;
   FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(l1_0, &v_7), _fx_catch_2);
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, v_7, &v_2);

_fx_catch_2: ;
   if (v_7) {
      _fx_free_N10Ast__exp_t(&v_7);
   }

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_2.t0, &ts_3);
   FX_COPY_PTR(v_2.t1, &else_e_0);
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(l1_0, &v_3, 0), _fx_cleanup);
   FX_CALL(
      _fx_M3AstFM5ExpIfN10Ast__exp_t4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(c_0, then_e_0, else_e_0,
         &v_3, &v_4), _fx_cleanup);
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_3, v_4, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (c_0) {
      _fx_free_N10Ast__exp_t(&c_0);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_1);
   if (ts_2) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
   }
   if (then_e_0) {
      _fx_free_N10Ast__exp_t(&then_e_0);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_2);
   if (ts_3) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
   }
   if (else_e_0) {
      _fx_free_N10Ast__exp_t(&else_e_0);
   }
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_3);
   if (v_4) {
      _fx_free_N10Ast__exp_t(&v_4);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM12parse_lambdaT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB v_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
   _fx_LN10Ast__pat_t params_0 = 0;
   _fx_N10Ast__typ_t rt_0 = 0;
   _fx_LN10Ast__exp_t prologue_0 = 0;
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_2 = {0};
   _fx_N10Ast__exp_t fname_exp_0 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_3 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
   _fx_N10Ast__exp_t df_0 = 0;
   _fx_LN10Ast__exp_t v_4 = 0;
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_5 = {0};
   _fx_N10Ast__exp_t v_6 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_7 = ts_0->tl;
      if (v_7 != 0) {
         if (v_7->hd.t0.tag == 44) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_8 = &ts_0->hd;
            if (v_8->t0.tag == 21) {
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t(v_7->tl, &v_8->t1, &v_0); goto _fx_endmatch_0;
            }
         }
      }
   }
   fx_exn_t v_9 = {0};
   _fx_R10Ast__loc_t loc_0;
   if (ts_0 != 0) {
      loc_0 = ts_0->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_0);
   fx_str_t slit_0 = FX_MAKE_STR("lambda function (starting with \'fun (\') is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_9), _fx_catch_0);
   FX_THROW(&v_9, true, _fx_catch_0);

_fx_catch_0: ;
   fx_free_exn(&v_9);

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   _fx_R10Ast__loc_t loc_1 = v_0.t1;
   FX_CALL(
      _fx_M6ParserFM16parse_fun_paramsT5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB1LT2N14Lexer__token_tR10Ast__loc_t(
         ts_1, &v_1, 0), _fx_cleanup);
   FX_COPY_PTR(v_1.t0, &ts_2);
   FX_COPY_PTR(v_1.t1, &params_0);
   FX_COPY_PTR(v_1.t2, &rt_0);
   FX_COPY_PTR(v_1.t3, &prologue_0);
   bool have_keywords_0 = v_1.t4;
   _fx_R9Ast__id_t fname_0;
   FX_CALL(_fx_M3AstFM6dup_idRM4id_t2iRM4id_t(_fx_g18Parser__parser_ctx.m_idx, &_fx_g18Ast__std__lambda__, &fname_0, 0),
      _fx_cleanup);
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&loc_1, &v_2, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&fname_0, &v_2, &fname_exp_0), _fx_cleanup);
   _fx_R16Ast__fun_flags_t v_10;
   FX_CALL(_fx_M3AstFM17default_fun_flagsRM11fun_flags_t0(&v_10, 0), _fx_cleanup);
   _fx_R16Ast__fun_flags_t v_11 =
      { v_10.fun_flag_pure, v_10.fun_flag_ccode, have_keywords_0, v_10.fun_flag_inline, v_10.fun_flag_nothrow,
         v_10.fun_flag_really_nothrow, true, v_10.fun_flag_ctor, v_10.fun_flag_method_of, v_10.fun_flag_uses_fv,
         v_10.fun_flag_recursive, v_10.fun_flag_instance };
   FX_CALL(
      _fx_M6ParserFM23parse_body_and_make_funT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t7LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tR16Ast__fun_flags_tR10Ast__loc_t(
         ts_2, &fname_0, params_0, rt_0, prologue_0, &v_11, &loc_1, &v_3, 0), _fx_cleanup);
   FX_COPY_PTR(v_3.t0, &ts_3);
   FX_COPY_PTR(v_3.t1, &df_0);
   FX_CALL(_fx_cons_LN10Ast__exp_t(fname_exp_0, 0, true, &v_4), _fx_cleanup);
   FX_CALL(_fx_cons_LN10Ast__exp_t(df_0, v_4, false, &v_4), _fx_cleanup);
   FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&loc_1, &v_5, 0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_4, &v_5, &v_6), _fx_cleanup);
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_3, v_6, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB(&v_1);
   if (ts_2) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
   }
   if (params_0) {
      _fx_free_LN10Ast__pat_t(&params_0);
   }
   if (rt_0) {
      _fx_free_N10Ast__typ_t(&rt_0);
   }
   if (prologue_0) {
      _fx_free_LN10Ast__exp_t(&prologue_0);
   }
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_2);
   if (fname_exp_0) {
      _fx_free_N10Ast__exp_t(&fname_exp_0);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_3);
   if (ts_3) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
   }
   if (df_0) {
      _fx_free_N10Ast__exp_t(&df_0);
   }
   if (v_4) {
      _fx_free_LN10Ast__exp_t(&v_4);
   }
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_5);
   if (v_6) {
      _fx_free_N10Ast__exp_t(&v_6);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM15parse_typed_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__exp_t e_0 = 0;
   int fx_status = 0;
   FX_CALL(
      _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
         &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &e_0);
   if (ts_1 != 0) {
      if (ts_1->hd.t0.tag == 54) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_1 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
         _fx_N10Ast__typ_t t_0 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_2 = {0};
         _fx_N10Ast__exp_t v_3 = 0;
         FX_CALL(
            _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_1->tl, &v_1, 0), _fx_catch_0);
         FX_COPY_PTR(v_1.t0, &ts_2);
         FX_COPY_PTR(v_1.t1, &t_0);
         _fx_R10Ast__loc_t v_4;
         FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_0, &v_4, 0), _fx_catch_0);
         FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_4, &v_2, 0), _fx_catch_0);
         FX_CALL(_fx_M3AstFM8ExpTypedN10Ast__exp_t3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tRM5loc_t(e_0, t_0, &v_2, &v_3),
            _fx_catch_0);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, v_3, fx_result);

      _fx_catch_0: ;
         if (v_3) {
            _fx_free_N10Ast__exp_t(&v_3);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_2);
         if (t_0) {
            _fx_free_N10Ast__typ_t(&t_0);
         }
         if (ts_2) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_1);
         goto _fx_endmatch_0;
      }
   }
   if (ts_1 != 0) {
      if (ts_1->hd.t0.tag == 57) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_5 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N10Ast__typ_t t_1 = 0;
         _fx_N10Ast__typ_t v_6 = 0;
         _fx_T2N10Ast__typ_tR10Ast__loc_t v_7 = {0};
         _fx_N10Ast__exp_t v_8 = 0;
         FX_CALL(
            _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_1->tl, &v_5, 0), _fx_catch_1);
         FX_COPY_PTR(v_5.t0, &ts_3);
         FX_COPY_PTR(v_5.t1, &t_1);
         FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_6, 0), _fx_catch_1);
         _fx_R10Ast__loc_t v_9;
         FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_0, &v_9, 0), _fx_catch_1);
         _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_6, &v_9, &v_7);
         FX_CALL(_fx_M3AstFM7ExpCastN10Ast__exp_t3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tRM5loc_t(e_0, t_1, &v_7, &v_8),
            _fx_catch_1);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_3, v_8, fx_result);

      _fx_catch_1: ;
         if (v_8) {
            _fx_free_N10Ast__exp_t(&v_8);
         }
         _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_7);
         if (v_6) {
            _fx_free_N10Ast__typ_t(&v_6);
         }
         if (t_1) {
            _fx_free_N10Ast__typ_t(&t_1);
         }
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_5);
         goto _fx_endmatch_0;
      }
   }
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1, e_0, fx_result);

_fx_endmatch_0: ;

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (e_0) {
      _fx_free_N10Ast__exp_t(&e_0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM13add_fun_paramT3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LN10Ast__pat_t_data_t* params_0,
   struct _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t_data_t* kw_params_0,
   struct _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* fx_result,
   void* fx_fv)
{
   _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t result_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__pat_t params_1 = 0;
   _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t kw_params_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(params_0, &params_1);
   FX_COPY_PTR(kw_params_0, &kw_params_1);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LN10Ast__pat_t params_2 = 0;
      _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t kw_params_2 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(params_1, &params_2);
      FX_COPY_PTR(kw_params_1, &kw_params_2);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               _fx_free_LN10Ast__pat_t(&params_1);
               FX_COPY_PTR(params_2, &params_1);
               _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&kw_params_1);
               FX_COPY_PTR(kw_params_2, &kw_params_1);
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_1;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 46) {
            _fx_LN10Ast__pat_t __fold_result___0 = 0;
            _fx_LN10Ast__pat_t v_1 = 0;
            _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t __fold_result___1 = 0;
            _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t v_2 = 0;
            _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t
               result_1 = {0};
            _fx_LN10Ast__pat_t lst_0 = params_2;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_LN10Ast__pat_t r_0 = 0;
               _fx_N10Ast__pat_t a_0 = lst_0->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LN10Ast__pat_t(a_0, r_0, false, &r_0), _fx_catch_1);
               _fx_free_LN10Ast__pat_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_1: ;
               if (r_0) {
                  _fx_free_LN10Ast__pat_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_3);
            }
            FX_COPY_PTR(__fold_result___0, &v_1);
            _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t lst_1 = kw_params_2;
            for (; lst_1; lst_1 = lst_1->tl) {
               _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t r_1 = 0;
               _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* a_1 = &lst_1->hd;
               FX_COPY_PTR(__fold_result___1, &r_1);
               FX_CALL(_fx_cons_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(a_1, r_1, false, &r_1), _fx_catch_2);
               _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&__fold_result___1);
               FX_COPY_PTR(r_1, &__fold_result___1);

            _fx_catch_2: ;
               if (r_1) {
                  _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&r_1);
               }
               FX_CHECK_EXN(_fx_catch_3);
            }
            FX_COPY_PTR(__fold_result___1, &v_2);
            _fx_make_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
               ts_2->tl, v_1, v_2, &result_1);
            _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
               &result_0);
            _fx_copy_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
               &result_1, &result_0);
            FX_BREAK(_fx_catch_3);

         _fx_catch_3: ;
            _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
               &result_1);
            if (v_2) {
               _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&v_2);
            }
            if (__fold_result___1) {
               _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&__fold_result___1);
            }
            if (v_1) {
               _fx_free_LN10Ast__pat_t(&v_1);
            }
            if (__fold_result___0) {
               _fx_free_LN10Ast__pat_t(&__fold_result___0);
            }
            goto _fx_endmatch_1;
         }
      }
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_3 = ts_2->tl;
         if (v_3 != 0) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_4 = v_3->tl;
            if (v_4 != 0) {
               if (v_4->hd.t0.tag == 54) {
                  _fx_N14Lexer__token_t* v_5 = &v_3->hd.t0;
                  if (v_5->tag == 2) {
                     _fx_T2N14Lexer__token_tR10Ast__loc_t* v_6 = &ts_2->hd;
                     if (v_6->t0.tag == 82) {
                        fx_exn_t v_7 = {0};
                        _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_8 = {0};
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
                        _fx_N10Ast__typ_t t_0 = 0;
                        _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_9 = {0};
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
                        _fx_N10Ast__exp_t defparam_0 = 0;
                        _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t v_10 = {0};
                        _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t v_11 = 0;
                        if (expect_comma_2) {
                           _fx_R10Ast__loc_t loc_1;
                           if (ts_2 != 0) {
                              loc_1 = ts_2->hd.t1;
                           }
                           else {
                              loc_1 = _fx_g18Parser__parser_ctx.default_loc;
                           }
                           FX_CHECK_EXN(_fx_catch_6);
                           fx_str_t slit_1 = FX_MAKE_STR("\',\' is expected");
                           FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_7), _fx_catch_6);
                           FX_THROW(&v_7, true, _fx_catch_6);
                        }
                        FX_CALL(
                           _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
                              v_4->tl, &v_8, 0), _fx_catch_6);
                        FX_COPY_PTR(v_8.t0, &ts_3);
                        FX_COPY_PTR(v_8.t1, &t_0);
                        if (ts_3 != 0) {
                           if (ts_3->hd.t0.tag == 86) {
                              _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_12 = {0};
                              _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
                              _fx_N10Ast__exp_t v0_0 = 0;
                              FX_CALL(
                                 _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                                    ts_3->tl, true, &v_12, 0), _fx_catch_4);
                              FX_COPY_PTR(v_12.t0, &ts_5);
                              FX_COPY_PTR(v_12.t1, &v0_0);
                              _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_5, v0_0, &v_9);

                           _fx_catch_4: ;
                              if (v0_0) {
                                 _fx_free_N10Ast__exp_t(&v0_0);
                              }
                              if (ts_5) {
                                 _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
                              }
                              _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_12);
                              goto _fx_endmatch_0;
                           }
                        }
                        if (ts_3 != 0) {
                           _fx_N10Ast__exp_t v_13 = 0;
                           FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&ts_3->hd.t1, &v_13), _fx_catch_5);
                           _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_3, v_13, &v_9);

                        _fx_catch_5: ;
                           if (v_13) {
                              _fx_free_N10Ast__exp_t(&v_13);
                           }
                           goto _fx_endmatch_0;
                        }
                        FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_6);

                     _fx_endmatch_0: ;
                        FX_CHECK_EXN(_fx_catch_6);
                        FX_COPY_PTR(v_9.t0, &ts_4);
                        FX_COPY_PTR(v_9.t1, &defparam_0);
                        _fx_R9Ast__id_t v_14;
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_5->u.IDENT.t1, &v_14, 0), _fx_catch_6);
                        _fx_make_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&v_14, t_0, defparam_0, &v_6->t1, &v_10);
                        FX_CALL(_fx_cons_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&v_10, kw_params_2, true, &v_11),
                           _fx_catch_6);
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                        FX_COPY_PTR(ts_4, &ts_1);
                        expect_comma_1 = true;
                        _fx_free_LN10Ast__pat_t(&params_1);
                        FX_COPY_PTR(params_2, &params_1);
                        _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&kw_params_1);
                        FX_COPY_PTR(v_11, &kw_params_1);

                     _fx_catch_6: ;
                        if (v_11) {
                           _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&v_11);
                        }
                        _fx_free_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&v_10);
                        if (defparam_0) {
                           _fx_free_N10Ast__exp_t(&defparam_0);
                        }
                        if (ts_4) {
                           _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
                        }
                        _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_9);
                        if (t_0) {
                           _fx_free_N10Ast__typ_t(&t_0);
                        }
                        if (ts_3) {
                           _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
                        }
                        _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_8);
                        fx_free_exn(&v_7);
                        goto _fx_endmatch_1;
                     }
                  }
               }
            }
         }
      }
      fx_exn_t v_15 = {0};
      fx_exn_t v_16 = {0};
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_17 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
      _fx_N10Ast__pat_t p_0 = 0;
      _fx_LN10Ast__pat_t v_18 = 0;
      if (expect_comma_2) {
         _fx_R10Ast__loc_t loc_2;
         if (ts_2 != 0) {
            loc_2 = ts_2->hd.t1;
         }
         else {
            loc_2 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_7);
         fx_str_t slit_2 = FX_MAKE_STR("\',\' is expected");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_15), _fx_catch_7);
         FX_THROW(&v_15, true, _fx_catch_7);
      }
      if (kw_params_2 != 0) {
         _fx_R10Ast__loc_t loc_3;
         if (ts_2 != 0) {
            loc_3 = ts_2->hd.t1;
         }
         else {
            loc_3 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_7);
         fx_str_t slit_3 = FX_MAKE_STR("positional parameters cannot occur after or between named parameters");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_3, &v_16), _fx_catch_7);
         FX_THROW(&v_16, true, _fx_catch_7);
      }
      FX_CALL(
         _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_2, true,
            &v_17, 0), _fx_catch_7);
      FX_COPY_PTR(v_17.t0, &ts_6);
      FX_COPY_PTR(v_17.t1, &p_0);
      FX_CALL(_fx_cons_LN10Ast__pat_t(p_0, params_2, true, &v_18), _fx_catch_7);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
      FX_COPY_PTR(ts_6, &ts_1);
      expect_comma_1 = true;
      _fx_free_LN10Ast__pat_t(&params_1);
      FX_COPY_PTR(v_18, &params_1);
      _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&kw_params_1);
      FX_COPY_PTR(kw_params_2, &kw_params_1);

   _fx_catch_7: ;
      if (v_18) {
         _fx_free_LN10Ast__pat_t(&v_18);
      }
      if (p_0) {
         _fx_free_N10Ast__pat_t(&p_0);
      }
      if (ts_6) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_17);
      fx_free_exn(&v_16);
      fx_free_exn(&v_15);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_8);

   _fx_catch_8: ;
      if (kw_params_2) {
         _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&kw_params_2);
      }
      if (params_2) {
         _fx_free_LN10Ast__pat_t(&params_2);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&result_0,
      fx_result);

_fx_cleanup: ;
   _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&result_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (params_1) {
      _fx_free_LN10Ast__pat_t(&params_1);
   }
   if (kw_params_1) {
      _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&kw_params_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM16parse_fun_paramsT5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB* fx_result,
   void* fx_fv)
{
   _fx_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__pat_t params_0 = 0;
   _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t kw_params_0 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
   _fx_N10Ast__typ_t rt_0 = 0;
   _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_0 = 0;
   _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_2 = {0};
   _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_3 = 0;
   _fx_N10Ast__typ_t rectyp_0 = 0;
   _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t v_4 = {0};
   _fx_LT2R9Ast__id_tN10Ast__pat_t v_5 = 0;
   _fx_N10Ast__pat_t recpat_0 = 0;
   _fx_T2N10Ast__typ_tR10Ast__loc_t v_6 = {0};
   _fx_N10Ast__exp_t v_7 = 0;
   _fx_R16Ast__val_flags_t v_8 = {0};
   _fx_N10Ast__exp_t unpack_rec_0 = 0;
   _fx_N10Ast__pat_t v_9 = 0;
   _fx_N10Ast__pat_t recparam_0 = 0;
   _fx_LN10Ast__pat_t v_10 = 0;
   _fx_LN10Ast__pat_t v_11 = 0;
   _fx_LN10Ast__exp_t v_12 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM13add_fun_paramT3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(
         ts_0, false, 0, 0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &params_0);
   FX_COPY_PTR(v_0.t2, &kw_params_0);
   if (ts_1 != 0) {
      if (ts_1->hd.t0.tag == 54) {
         FX_CALL(
            _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_1->tl, &v_1, 0), _fx_catch_0);

      _fx_catch_0: ;
         goto _fx_endmatch_0;
      }
   }
   _fx_N10Ast__typ_t v_13 = 0;
   FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_13, 0), _fx_catch_1);
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(ts_1, v_13, &v_1);

_fx_catch_1: ;
   if (v_13) {
      _fx_free_N10Ast__typ_t(&v_13);
   }

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_1.t0, &ts_2);
   FX_COPY_PTR(v_1.t1, &rt_0);
   if (kw_params_0 == 0) {
      _fx_make_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB(ts_2, params_0, rt_0, 0, false,
         fx_result);
   }
   else {
      _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lstend_0 = 0;
      _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t lst_0 = kw_params_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_N10Ast__typ_t t_0 = 0;
         _fx_N10Ast__exp_t v0_0 = 0;
         _fx_R16Ast__val_flags_t v_14 = {0};
         _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t tup_0 = {0};
         _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* __pat___0 = &lst_0->hd;
         _fx_R9Ast__id_t i_0 = __pat___0->t0;
         FX_COPY_PTR(__pat___0->t1, &t_0);
         FX_COPY_PTR(__pat___0->t2, &v0_0);
         FX_CALL(_fx_M3AstFM17default_arg_flagsRM11val_flags_t0(&v_14, 0), _fx_catch_2);
         _fx_make_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&v_14, &i_0, t_0, v0_0, &tup_0);
         _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t node_0 = 0;
         FX_CALL(_fx_cons_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&tup_0, 0, false, &node_0), _fx_catch_2);
         FX_LIST_APPEND(relems_0, lstend_0, node_0);

      _fx_catch_2: ;
         _fx_free_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&tup_0);
         _fx_free_R16Ast__val_flags_t(&v_14);
         if (v0_0) {
            _fx_free_N10Ast__exp_t(&v0_0);
         }
         if (t_0) {
            _fx_free_N10Ast__typ_t(&t_0);
         }
         FX_CHECK_EXN(_fx_cleanup);
      }
      _fx_make_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(relems_0, true, &v_2);
      FX_CALL(_fx_make_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_2, &v_3), _fx_cleanup);
      FX_CALL(_fx_M3AstFM9TypRecordN10Ast__typ_t1rT2LT4RM11val_flags_tRM4id_tN10Ast__typ_tN10Ast__exp_tB(v_3, &rectyp_0),
         _fx_cleanup);
      if (kw_params_0 != 0) {
         _fx_copy_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&kw_params_0->hd, &v_4);
      }
      else {
         FX_FAST_THROW(FX_EXN_NullListError, _fx_cleanup);
      }
      FX_CHECK_EXN(_fx_cleanup);
      _fx_R10Ast__loc_t loc_0 = v_4.t3;
      _fx_LT2R9Ast__id_tN10Ast__pat_t lstend_1 = 0;
      _fx_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t lst_1 = kw_params_0;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_N10Ast__pat_t v_15 = 0;
         _fx_T2R9Ast__id_tN10Ast__pat_t tup_1 = {0};
         _fx_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t* __pat___1 = &lst_1->hd;
         _fx_R9Ast__id_t i_1 = __pat___1->t0;
         _fx_R10Ast__loc_t loci_0 = __pat___1->t3;
         FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&i_1, &loci_0, &v_15), _fx_catch_3);
         _fx_make_T2R9Ast__id_tN10Ast__pat_t(&i_1, v_15, &tup_1);
         _fx_LT2R9Ast__id_tN10Ast__pat_t node_1 = 0;
         FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__pat_t(&tup_1, 0, false, &node_1), _fx_catch_3);
         FX_LIST_APPEND(v_5, lstend_1, node_1);

      _fx_catch_3: ;
         _fx_free_T2R9Ast__id_tN10Ast__pat_t(&tup_1);
         if (v_15) {
            _fx_free_N10Ast__pat_t(&v_15);
         }
         FX_CHECK_EXN(_fx_cleanup);
      }
      FX_CALL(
         _fx_M3AstFM9PatRecordN10Ast__pat_t3Nt6option1RM4id_tLT2RM4id_tN10Ast__pat_tRM5loc_t(&_fx_g14Parser__None1_, v_5,
            &loc_0, &recpat_0), _fx_cleanup);
      FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&loc_0, &v_6, 0), _fx_cleanup);
      FX_CALL(_fx_M3AstFM8ExpIdentN10Ast__exp_t2RM4id_tT2N10Ast__typ_tRM5loc_t(&_fx_g18Ast__std__kwargs__, &v_6, &v_7),
         _fx_cleanup);
      FX_CALL(_fx_M3AstFM21default_tempval_flagsRM11val_flags_t0(&v_8, 0), _fx_cleanup);
      FX_CALL(
         _fx_M3AstFM6DefValN10Ast__exp_t4N10Ast__pat_tN10Ast__exp_tRM11val_flags_tRM5loc_t(recpat_0, v_7, &v_8, &loc_0,
            &unpack_rec_0), _fx_cleanup);
      FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&_fx_g18Ast__std__kwargs__, &loc_0, &v_9), _fx_cleanup);
      FX_CALL(_fx_M3AstFM8PatTypedN10Ast__pat_t3N10Ast__pat_tN10Ast__typ_tRM5loc_t(v_9, rectyp_0, &loc_0, &recparam_0),
         _fx_cleanup);
      FX_CALL(_fx_cons_LN10Ast__pat_t(recparam_0, 0, true, &v_10), _fx_cleanup);
      if (params_0 == 0) {
         FX_COPY_PTR(v_10, &v_11);
      }
      else if (v_10 == 0) {
         FX_COPY_PTR(params_0, &v_11);
      }
      else {
         _fx_LN10Ast__pat_t v_16 = 0;
         _fx_LN10Ast__pat_t lstend_2 = 0;
         _fx_LN10Ast__pat_t lst_2 = params_0;
         for (; lst_2; lst_2 = lst_2->tl) {
            _fx_N10Ast__pat_t x_0 = lst_2->hd;
            _fx_LN10Ast__pat_t node_2 = 0;
            FX_CALL(_fx_cons_LN10Ast__pat_t(x_0, 0, false, &node_2), _fx_catch_4);
            FX_LIST_APPEND(v_16, lstend_2, node_2);

         _fx_catch_4: ;
            FX_CHECK_EXN(_fx_catch_5);
         }
         _fx_M6ParserFM5link2LN10Ast__pat_t2LN10Ast__pat_tLN10Ast__pat_t(v_16, v_10, &v_11, 0);

      _fx_catch_5: ;
         if (v_16) {
            _fx_free_LN10Ast__pat_t(&v_16);
         }
      }
      FX_CHECK_EXN(_fx_cleanup);
      FX_CALL(_fx_cons_LN10Ast__exp_t(unpack_rec_0, 0, true, &v_12), _fx_cleanup);
      _fx_make_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB(ts_2, v_11, rt_0, v_12, true,
         fx_result);
   }

_fx_cleanup: ;
   _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tLT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (params_0) {
      _fx_free_LN10Ast__pat_t(&params_0);
   }
   if (kw_params_0) {
      _fx_free_LT4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&kw_params_0);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_1);
   if (ts_2) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
   }
   if (rt_0) {
      _fx_free_N10Ast__typ_t(&rt_0);
   }
   if (relems_0) {
      _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_0);
   }
   _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_2);
   if (v_3) {
      _fx_free_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_3);
   }
   if (rectyp_0) {
      _fx_free_N10Ast__typ_t(&rectyp_0);
   }
   _fx_free_T4R9Ast__id_tN10Ast__typ_tN10Ast__exp_tR10Ast__loc_t(&v_4);
   if (v_5) {
      _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&v_5);
   }
   if (recpat_0) {
      _fx_free_N10Ast__pat_t(&recpat_0);
   }
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_6);
   if (v_7) {
      _fx_free_N10Ast__exp_t(&v_7);
   }
   _fx_free_R16Ast__val_flags_t(&v_8);
   if (unpack_rec_0) {
      _fx_free_N10Ast__exp_t(&unpack_rec_0);
   }
   if (v_9) {
      _fx_free_N10Ast__pat_t(&v_9);
   }
   if (recparam_0) {
      _fx_free_N10Ast__pat_t(&recparam_0);
   }
   if (v_10) {
      _fx_free_LN10Ast__pat_t(&v_10);
   }
   if (v_11) {
      _fx_free_LN10Ast__pat_t(&v_11);
   }
   if (v_12) {
      _fx_free_LN10Ast__exp_t(&v_12);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM23parse_body_and_make_funT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t7LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tR16Ast__fun_flags_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_R9Ast__id_t* fname_0,
   struct _fx_LN10Ast__pat_t_data_t* params_0,
   struct _fx_N10Ast__typ_t_data_t* rt_0,
   struct _fx_LN10Ast__exp_t_data_t* prologue_0,
   struct _fx_R16Ast__fun_flags_t* fflags_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__pat_t params_1 = 0;
   _fx_N10Ast__exp_t body_0 = 0;
   _fx_N10Ast__exp_t body_1 = 0;
   _fx_LN10Ast__exp_t v_1 = 0;
   _fx_LN10Ast__exp_t v_2 = 0;
   _fx_LN10Ast__typ_t paramtyps_0 = 0;
   _fx_N10Ast__typ_t v_3 = 0;
   _fx_rLR9Ast__id_t v_4 = 0;
   _fx_R13Ast__deffun_t v_5 = {0};
   _fx_rR13Ast__deffun_t df_0 = 0;
   _fx_N10Ast__exp_t v_6 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_7 = ts_0->tl;
      if (v_7 != 0) {
         if (ts_0->hd.t0.tag == 86) {
            if (v_7->hd.t0.tag == 9) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_8 = 0;
               _fx_N10Ast__typ_t v_9 = 0;
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_10 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
               _fx_N10Ast__exp_t body_2 = 0;
               if (ts_0 != 0) {
                  FX_COPY_PTR(ts_0->tl, &v_8);
               }
               else {
                  FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_0);
               }
               FX_CHECK_EXN(_fx_catch_0);
               FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_9, 0), _fx_catch_0);
               FX_CALL(
                  _fx_M6ParserFM15parse_ccode_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
                     v_8, v_9, &v_10, 0), _fx_catch_0);
               FX_COPY_PTR(v_10.t0, &ts_2);
               FX_COPY_PTR(v_10.t1, &body_2);
               _fx_R16Ast__fun_flags_t v_11 =
                  { fflags_0->fun_flag_pure, true, fflags_0->fun_flag_have_keywords, fflags_0->fun_flag_inline,
                     fflags_0->fun_flag_nothrow, fflags_0->fun_flag_really_nothrow, fflags_0->fun_flag_private,
                     fflags_0->fun_flag_ctor, fflags_0->fun_flag_method_of, fflags_0->fun_flag_uses_fv,
                     fflags_0->fun_flag_recursive, fflags_0->fun_flag_instance };
               _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t(ts_2, params_0,
                  body_2, &v_11, &v_0);

            _fx_catch_0: ;
               if (body_2) {
                  _fx_free_N10Ast__exp_t(&body_2);
               }
               if (ts_2) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_10);
               if (v_9) {
                  _fx_free_N10Ast__typ_t(&v_9);
               }
               if (v_8) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_8);
               }
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 9) {
         _fx_N10Ast__typ_t v_12 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_13 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N10Ast__exp_t body_3 = 0;
         FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_12, 0), _fx_catch_1);
         FX_CALL(
            _fx_M6ParserFM15parse_ccode_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
               ts_0, v_12, &v_13, 0), _fx_catch_1);
         FX_COPY_PTR(v_13.t0, &ts_3);
         FX_COPY_PTR(v_13.t1, &body_3);
         _fx_R16Ast__fun_flags_t v_14 =
            { fflags_0->fun_flag_pure, true, fflags_0->fun_flag_have_keywords, fflags_0->fun_flag_inline,
               fflags_0->fun_flag_nothrow, fflags_0->fun_flag_really_nothrow, fflags_0->fun_flag_private,
               fflags_0->fun_flag_ctor, fflags_0->fun_flag_method_of, fflags_0->fun_flag_uses_fv, fflags_0->fun_flag_recursive,
               fflags_0->fun_flag_instance };
         _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t(ts_3, params_0, body_3,
            &v_14, &v_0);

      _fx_catch_1: ;
         if (body_3) {
            _fx_free_N10Ast__exp_t(&body_3);
         }
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_13);
         if (v_12) {
            _fx_free_N10Ast__typ_t(&v_12);
         }
         goto _fx_endmatch_0;
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 86) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_15 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_16 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_N10Ast__exp_t body_4 = 0;
         if (ts_0 != 0) {
            FX_COPY_PTR(ts_0->tl, &v_15);
         }
         else {
            FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_2);
         }
         FX_CHECK_EXN(_fx_catch_2);
         FX_CALL(
            _fx_M6ParserFM10parse_stmtT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(v_15,
               &v_16, 0), _fx_catch_2);
         FX_COPY_PTR(v_16.t0, &ts_4);
         FX_COPY_PTR(v_16.t1, &body_4);
         _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t(ts_4, params_0, body_4,
            fflags_0, &v_0);

      _fx_catch_2: ;
         if (body_4) {
            _fx_free_N10Ast__exp_t(&body_4);
         }
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_16);
         if (v_15) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_15);
         }
         goto _fx_endmatch_0;
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_17 = ts_0->tl;
      if (v_17 != 0) {
         if (v_17->hd.t0.tag == 55) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_18 = &ts_0->hd;
            if (v_18->t0.tag == 49) {
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t v_19 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
               _fx_LT2N10Ast__pat_tN10Ast__exp_t cases_0 = 0;
               _fx_T2LN10Ast__pat_tN10Ast__exp_t v_20 = {0};
               _fx_LN10Ast__pat_t params_2 = 0;
               _fx_N10Ast__exp_t match_arg_0 = 0;
               _fx_T2N10Ast__typ_tR10Ast__loc_t v_21 = {0};
               _fx_N10Ast__exp_t match_e_0 = 0;
               _fx_R10Ast__loc_t* l1_0 = &v_18->t1;
               FX_CALL(
                  _fx_M6ParserFM17parse_match_casesT2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                     ts_0, &v_19, 0), _fx_catch_3);
               FX_COPY_PTR(v_19.t0, &ts_5);
               FX_COPY_PTR(v_19.t1, &cases_0);
               FX_CALL(
                  _fx_M6ParserFM9plist2expT2LN10Ast__pat_tN10Ast__exp_t2LN10Ast__pat_tR10Ast__loc_t(params_0, l1_0, &v_20, 0),
                  _fx_catch_3);
               FX_COPY_PTR(v_20.t0, &params_2);
               FX_COPY_PTR(v_20.t1, &match_arg_0);
               FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(l1_0, &v_21, 0), _fx_catch_3);
               FX_CALL(
                  _fx_M3AstFM8ExpMatchN10Ast__exp_t3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(
                     match_arg_0, cases_0, &v_21, &match_e_0), _fx_catch_3);
               _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t(ts_5, params_2,
                  match_e_0, fflags_0, &v_0);

            _fx_catch_3: ;
               if (match_e_0) {
                  _fx_free_N10Ast__exp_t(&match_e_0);
               }
               _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_21);
               if (match_arg_0) {
                  _fx_free_N10Ast__exp_t(&match_arg_0);
               }
               if (params_2) {
                  _fx_free_LN10Ast__pat_t(&params_2);
               }
               _fx_free_T2LN10Ast__pat_tN10Ast__exp_t(&v_20);
               if (cases_0) {
                  _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&cases_0);
               }
               if (ts_5) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(&v_19);
               goto _fx_endmatch_0;
            }
         }
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 49) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_22 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
         _fx_N10Ast__exp_t body_5 = 0;
         FX_CALL(
            _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
               &v_22, 0), _fx_catch_4);
         FX_COPY_PTR(v_22.t0, &ts_6);
         FX_COPY_PTR(v_22.t1, &body_5);
         _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t(ts_6, params_0, body_5,
            fflags_0, &v_0);

      _fx_catch_4: ;
         if (body_5) {
            _fx_free_N10Ast__exp_t(&body_5);
         }
         if (ts_6) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_22);
         goto _fx_endmatch_0;
      }
   }
   fx_exn_t v_23 = {0};
   _fx_R10Ast__loc_t loc_1;
   if (ts_0 != 0) {
      loc_1 = ts_0->hd.t1;
   }
   else {
      loc_1 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_5);
   fx_str_t slit_0 = FX_MAKE_STR("\'=\' or \'{\' is expected before the function body");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_0, &v_23), _fx_catch_5);
   FX_THROW(&v_23, true, _fx_catch_5);

_fx_catch_5: ;
   fx_free_exn(&v_23);

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &params_1);
   FX_COPY_PTR(v_0.t2, &body_0);
   _fx_R16Ast__fun_flags_t fflags_1 = v_0.t3;
   if (prologue_0 == 0) {
      FX_COPY_PTR(body_0, &body_1);
   }
   else {
      _fx_R10Ast__loc_t loc_2;
      FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(body_0, &loc_2, 0), _fx_cleanup);
      int tag_0 = FX_REC_VARIANT_TAG(body_0);
      if (tag_0 != 1) {
         if (tag_0 == 12) {
            FX_COPY_PTR(body_0->u.ExpSeq.t0, &v_1);
         }
         else {
            FX_CALL(_fx_cons_LN10Ast__exp_t(body_0, 0, true, &v_1), _fx_catch_6);  _fx_catch_6: ;
         }
      }
      FX_CHECK_EXN(_fx_cleanup);
      if (prologue_0 == 0) {
         FX_COPY_PTR(v_1, &v_2);
      }
      else if (v_1 == 0) {
         FX_COPY_PTR(prologue_0, &v_2);
      }
      else {
         _fx_LN10Ast__exp_t v_24 = 0;
         _fx_LN10Ast__exp_t lstend_0 = 0;
         _fx_LN10Ast__exp_t lst_0 = prologue_0;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_N10Ast__exp_t x_0 = lst_0->hd;
            _fx_LN10Ast__exp_t node_0 = 0;
            FX_CALL(_fx_cons_LN10Ast__exp_t(x_0, 0, false, &node_0), _fx_catch_7);
            FX_LIST_APPEND(v_24, lstend_0, node_0);

         _fx_catch_7: ;
            FX_CHECK_EXN(_fx_catch_8);
         }
         _fx_M6ParserFM5link2LN10Ast__exp_t2LN10Ast__exp_tLN10Ast__exp_t(v_24, v_1, &v_2, 0);

      _fx_catch_8: ;
         if (v_24) {
            _fx_free_LN10Ast__exp_t(&v_24);
         }
      }
      FX_CHECK_EXN(_fx_cleanup);
      if (v_2 == 0) {
         FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&loc_2, &body_1), _fx_catch_9);  _fx_catch_9: ; goto _fx_endmatch_1;
      }
      if (v_2 != 0) {
         if (v_2->tl == 0) {
            FX_COPY_PTR(v_2->hd, &body_1); goto _fx_endmatch_1;
         }
      }
      _fx_LR10Ast__loc_t llist_0 = 0;
      _fx_N10Ast__typ_t v_25 = 0;
      _fx_T2N10Ast__typ_tR10Ast__loc_t v_26 = {0};
      _fx_LR10Ast__loc_t lstend_1 = 0;
      _fx_LN10Ast__exp_t lst_1 = v_2;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_N10Ast__exp_t e_0 = lst_1->hd;
         _fx_R10Ast__loc_t res_0;
         FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_0, &res_0, 0), _fx_catch_10);
         _fx_LR10Ast__loc_t node_1 = 0;
         FX_CALL(_fx_cons_LR10Ast__loc_t(&res_0, 0, false, &node_1), _fx_catch_10);
         FX_LIST_APPEND(llist_0, lstend_1, node_1);

      _fx_catch_10: ;
         FX_CHECK_EXN(_fx_catch_11);
      }
      _fx_R10Ast__loc_t loc_3;
      FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(llist_0, &loc_2, &loc_3, 0), _fx_catch_11);
      FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_25, 0), _fx_catch_11);
      _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_25, &loc_3, &v_26);
      FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_2, &v_26, &body_1), _fx_catch_11);

   _fx_catch_11: ;
      _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_26);
      if (v_25) {
         _fx_free_N10Ast__typ_t(&v_25);
      }
      FX_FREE_LIST_SIMPLE(&llist_0);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_LN10Ast__typ_t lstend_2 = 0;
   _fx_LN10Ast__pat_t lst_2 = params_1;
   for (; lst_2; lst_2 = lst_2->tl) {
      _fx_N10Ast__typ_t res_1 = 0;
      _fx_N10Ast__pat_t p_0 = lst_2->hd;
      if (FX_REC_VARIANT_TAG(p_0) == 9) {
         FX_COPY_PTR(p_0->u.PatTyped.t1, &res_1);
      }
      else {
         FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&res_1, 0), _fx_catch_12);  _fx_catch_12: ;
      }
      FX_CHECK_EXN(_fx_catch_13);
      _fx_LN10Ast__typ_t node_2 = 0;
      FX_CALL(_fx_cons_LN10Ast__typ_t(res_1, 0, false, &node_2), _fx_catch_13);
      FX_LIST_APPEND(paramtyps_0, lstend_2, node_2);

   _fx_catch_13: ;
      if (res_1) {
         _fx_free_N10Ast__typ_t(&res_1);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_CALL(_fx_M3AstFM6TypFunN10Ast__typ_t2LN10Ast__typ_tN10Ast__typ_t(paramtyps_0, rt_0, &v_3), _fx_cleanup);
   FX_CALL(_fx_make_rLR9Ast__id_t(0, &v_4), _fx_cleanup);
   _fx_make_R13Ast__deffun_t(fname_0, 0, params_1, v_3, body_1, &fflags_1, 0, loc_0, v_4, &_fx_g14Ast__empty_env, &v_5);
   FX_CALL(_fx_make_rR13Ast__deffun_t(&v_5, &df_0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM6DefFunN10Ast__exp_t1rRM8deffun_t(df_0, &v_6), _fx_cleanup);
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1, v_6, fx_result);

_fx_cleanup: ;
   _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__exp_tR16Ast__fun_flags_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (params_1) {
      _fx_free_LN10Ast__pat_t(&params_1);
   }
   if (body_0) {
      _fx_free_N10Ast__exp_t(&body_0);
   }
   if (body_1) {
      _fx_free_N10Ast__exp_t(&body_1);
   }
   if (v_1) {
      _fx_free_LN10Ast__exp_t(&v_1);
   }
   if (v_2) {
      _fx_free_LN10Ast__exp_t(&v_2);
   }
   if (paramtyps_0) {
      _fx_free_LN10Ast__typ_t(&paramtyps_0);
   }
   if (v_3) {
      _fx_free_N10Ast__typ_t(&v_3);
   }
   if (v_4) {
      _fx_free_rLR9Ast__id_t(&v_4);
   }
   _fx_free_R13Ast__deffun_t(&v_5);
   if (df_0) {
      _fx_free_rR13Ast__deffun_t(&df_0);
   }
   if (v_6) {
      _fx_free_N10Ast__exp_t(&v_6);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10parse_stmtT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_0 = &ts_0->hd;
      if (v_0->t0.tag == 7) {
         _fx_N10Ast__exp_t v_1 = 0;
         FX_CALL(_fx_M3AstFM8ExpBreakN10Ast__exp_t2BRM5loc_t(false, &v_0->t1, &v_1), _fx_catch_0);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_0->tl, v_1, fx_result);

      _fx_catch_0: ;
         if (v_1) {
            _fx_free_N10Ast__exp_t(&v_1);
         }
         goto _fx_endmatch_5;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_2 = &ts_0->hd;
      if (v_2->t0.tag == 11) {
         _fx_N10Ast__exp_t v_3 = 0;
         FX_CALL(_fx_M3AstFM11ExpContinueN10Ast__exp_t1RM5loc_t(&v_2->t1, &v_3), _fx_catch_1);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_0->tl, v_3, fx_result);

      _fx_catch_1: ;
         if (v_3) {
            _fx_free_N10Ast__exp_t(&v_3);
         }
         goto _fx_endmatch_5;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_4 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_5 = &v_4->t0;
      if (v_5->tag == 34) {
         if (v_5->u.RETURN == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_6 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
            _fx_N10Ast__exp_t e_0 = 0;
            _fx_Nt6option1N10Ast__exp_t v_7 = 0;
            _fx_N10Ast__exp_t v_8 = 0;
            FX_CALL(
               _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_0->tl, true, &v_6, 0), _fx_catch_2);
            FX_COPY_PTR(v_6.t0, &ts_1);
            FX_COPY_PTR(v_6.t1, &e_0);
            FX_CALL(_fx_M6ParserFM4SomeNt6option1N10Ast__exp_t1N10Ast__exp_t(e_0, &v_7), _fx_catch_2);
            FX_CALL(_fx_M3AstFM9ExpReturnN10Ast__exp_t2Nt6option1N10Ast__exp_tRM5loc_t(v_7, &v_4->t1, &v_8), _fx_catch_2);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_1, v_8, fx_result);

         _fx_catch_2: ;
            if (v_8) {
               _fx_free_N10Ast__exp_t(&v_8);
            }
            if (v_7) {
               _fx_free_Nt6option1N10Ast__exp_t(&v_7);
            }
            if (e_0) {
               _fx_free_N10Ast__exp_t(&e_0);
            }
            if (ts_1) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_6);
            goto _fx_endmatch_5;
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_9 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_10 = &v_9->t0;
      if (v_10->tag == 34) {
         if (v_10->u.RETURN == false) {
            _fx_N10Ast__exp_t v_11 = 0;
            FX_CALL(_fx_M3AstFM9ExpReturnN10Ast__exp_t2Nt6option1N10Ast__exp_tRM5loc_t(_fx_g14Parser__None2_, &v_9->t1, &v_11),
               _fx_catch_3);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_0->tl, v_11, fx_result);

         _fx_catch_3: ;
            if (v_11) {
               _fx_free_N10Ast__exp_t(&v_11);
            }
            goto _fx_endmatch_5;
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_12 = &ts_0->hd;
      if (v_12->t0.tag == 35) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_13 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
         _fx_N10Ast__exp_t e_1 = 0;
         _fx_N10Ast__exp_t v_14 = 0;
         FX_CALL(
            _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
               ts_0->tl, true, &v_13, 0), _fx_catch_4);
         FX_COPY_PTR(v_13.t0, &ts_2);
         FX_COPY_PTR(v_13.t1, &e_1);
         FX_CALL(_fx_M3AstFM8ExpThrowN10Ast__exp_t2N10Ast__exp_tRM5loc_t(e_1, &v_12->t1, &v_14), _fx_catch_4);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_2, v_14, fx_result);

      _fx_catch_4: ;
         if (v_14) {
            _fx_free_N10Ast__exp_t(&v_14);
         }
         if (e_1) {
            _fx_free_N10Ast__exp_t(&e_1);
         }
         if (ts_2) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_13);
         goto _fx_endmatch_5;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_15 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_16 = &v_15->t0;
      if (v_16->tag == 42) {
         if (v_16->u.WHILE == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_17 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
            _fx_N10Ast__exp_t c_0 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_18 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
            _fx_N10Ast__exp_t body_0 = 0;
            _fx_N10Ast__exp_t v_19 = 0;
            FX_CALL(
               _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_0->tl, false, &v_17, 0), _fx_catch_5);
            FX_COPY_PTR(v_17.t0, &ts_3);
            FX_COPY_PTR(v_17.t1, &c_0);
            FX_CALL(
               _fx_M6ParserFM11parse_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                  ts_3, &v_18, 0), _fx_catch_5);
            FX_COPY_PTR(v_18.t0, &ts_4);
            FX_COPY_PTR(v_18.t1, &body_0);
            FX_CALL(_fx_M3AstFM8ExpWhileN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tRM5loc_t(c_0, body_0, &v_15->t1, &v_19),
               _fx_catch_5);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_4, v_19, fx_result);

         _fx_catch_5: ;
            if (v_19) {
               _fx_free_N10Ast__exp_t(&v_19);
            }
            if (body_0) {
               _fx_free_N10Ast__exp_t(&body_0);
            }
            if (ts_4) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_18);
            if (c_0) {
               _fx_free_N10Ast__exp_t(&c_0);
            }
            if (ts_3) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_17);
            goto _fx_endmatch_5;
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_20 = &ts_0->hd;
      if (v_20->t0.tag == 12) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_21 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
         _fx_N10Ast__exp_t body_1 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_22 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
         _fx_N10Ast__exp_t c_1 = 0;
         _fx_N10Ast__exp_t v_23 = 0;
         FX_CALL(
            _fx_M6ParserFM18parse_exp_or_blockT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_0->tl, &v_21, 0), _fx_catch_8);
         FX_COPY_PTR(v_21.t0, &ts_5);
         FX_COPY_PTR(v_21.t1, &body_1);
         if (ts_5 != 0) {
            if (ts_5->hd.t0.tag == 42) {
               FX_CALL(
                  _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                     ts_5->tl, false, &v_22, 0), _fx_catch_6);

            _fx_catch_6: ;
               goto _fx_endmatch_0;
            }
         }
         fx_exn_t v_24 = {0};
         _fx_R10Ast__loc_t loc_0;
         if (ts_5 != 0) {
            loc_0 = ts_5->hd.t1;
         }
         else {
            loc_0 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_7);
         fx_str_t slit_0 = FX_MAKE_STR("\'while\' is expected in do-while loop");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_24), _fx_catch_7);
         FX_THROW(&v_24, true, _fx_catch_7);

      _fx_catch_7: ;
         fx_free_exn(&v_24);

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_8);
         FX_COPY_PTR(v_22.t0, &ts_6);
         FX_COPY_PTR(v_22.t1, &c_1);
         FX_CALL(_fx_M3AstFM10ExpDoWhileN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tRM5loc_t(body_1, c_1, &v_20->t1, &v_23),
            _fx_catch_8);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_6, v_23, fx_result);

      _fx_catch_8: ;
         if (v_23) {
            _fx_free_N10Ast__exp_t(&v_23);
         }
         if (c_1) {
            _fx_free_N10Ast__exp_t(&c_1);
         }
         if (ts_6) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_22);
         if (body_1) {
            _fx_free_N10Ast__exp_t(&body_1);
         }
         if (ts_5) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_21);
         goto _fx_endmatch_5;
      }
   }
   bool res_0;
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 29) {
         res_0 = true; goto _fx_endmatch_1;
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 19) {
         res_0 = true; goto _fx_endmatch_1;
      }
   }
   res_0 = false;

_fx_endmatch_1: ;
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      _fx_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t v_25 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_7 = 0;
      _fx_N10Ast__exp_t for_exp_0 = 0;
      FX_CALL(
         _fx_M6ParserFM9parse_forT3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tN15Ast__for_make_t(
            ts_0, &_fx_g19Parser__ForMakeNone, &v_25, 0), _fx_catch_9);
      FX_COPY_PTR(v_25.t0, &ts_7);
      FX_COPY_PTR(v_25.t1, &for_exp_0);
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_7, for_exp_0, fx_result);

   _fx_catch_9: ;
      if (for_exp_0) {
         _fx_free_N10Ast__exp_t(&for_exp_0);
      }
      if (ts_7) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_7);
      }
      _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_tN10Ast__exp_t(&v_25);
      goto _fx_endmatch_5;
   }
   if (ts_0 != 0) {
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_26 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_8 = 0;
      _fx_N10Ast__exp_t e1_0 = 0;
      FX_CALL(
         _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
            ts_0, &v_26, 0), _fx_catch_13);
      FX_COPY_PTR(v_26.t0, &ts_8);
      FX_COPY_PTR(v_26.t1, &e1_0);
      int tag_0 = FX_REC_VARIANT_TAG(e1_0);
      bool lvalue_e1_0;
      bool res_1;
      if (tag_0 == 9) {
         if (e1_0->u.ExpUnary.t0.tag == 7) {
            res_1 = true; goto _fx_endmatch_2;
         }
      }
      if (tag_0 == 7) {
         res_1 = true; goto _fx_endmatch_2;
      }
      if (tag_0 == 19) {
         res_1 = true; goto _fx_endmatch_2;
      }
      if (tag_0 == 21) {
         res_1 = true; goto _fx_endmatch_2;
      }
      res_1 = false;

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_13);
      if (res_1) {
         lvalue_e1_0 = true; goto _fx_endmatch_3;
      }
      lvalue_e1_0 = false;

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_13);
      if (ts_8 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_27 = &ts_8->hd;
         if (v_27->t0.tag == 86) {
            fx_exn_t v_28 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_29 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_9 = 0;
            _fx_N10Ast__exp_t e2_0 = 0;
            _fx_N10Ast__exp_t v_30 = 0;
            if (!lvalue_e1_0) {
               _fx_R10Ast__loc_t loc_1;
               if (ts_8 != 0) {
                  loc_1 = ts_8->hd.t1;
               }
               else {
                  loc_1 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_10);
               fx_str_t slit_1 = FX_MAKE_STR("left-hand-side of the assignment is not an l-value");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_28), _fx_catch_10);
               FX_THROW(&v_28, true, _fx_catch_10);
            }
            FX_CALL(
               _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                  ts_8->tl, &v_29, 0), _fx_catch_10);
            FX_COPY_PTR(v_29.t0, &ts_9);
            FX_COPY_PTR(v_29.t1, &e2_0);
            FX_CALL(_fx_M3AstFM9ExpAssignN10Ast__exp_t3N10Ast__exp_tN10Ast__exp_tRM5loc_t(e1_0, e2_0, &v_27->t1, &v_30),
               _fx_catch_10);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_9, v_30, fx_result);

         _fx_catch_10: ;
            if (v_30) {
               _fx_free_N10Ast__exp_t(&v_30);
            }
            if (e2_0) {
               _fx_free_N10Ast__exp_t(&e2_0);
            }
            if (ts_9) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_9);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_29);
            fx_free_exn(&v_28);
            goto _fx_endmatch_4;
         }
      }
      if (ts_8 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_31 = &ts_8->hd;
         _fx_N14Lexer__token_t* v_32 = &v_31->t0;
         if (v_32->tag == 88) {
            fx_exn_t v_33 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_34 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_10 = 0;
            _fx_N10Ast__exp_t e2_1 = 0;
            _fx_N13Ast__binary_t v_35 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_36 = {0};
            _fx_N10Ast__exp_t v_37 = 0;
            if (!lvalue_e1_0) {
               _fx_R10Ast__loc_t loc_2;
               if (ts_8 != 0) {
                  loc_2 = ts_8->hd.t1;
               }
               else {
                  loc_2 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_11);
               fx_str_t slit_2 = FX_MAKE_STR("left-hand-side of the assignment is not an l-value");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_33), _fx_catch_11);
               FX_THROW(&v_33, true, _fx_catch_11);
            }
            FX_CALL(
               _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                  ts_8->tl, &v_34, 0), _fx_catch_11);
            FX_COPY_PTR(v_34.t0, &ts_10);
            FX_COPY_PTR(v_34.t1, &e2_1);
            FX_CALL(_fx_M3AstFM11OpAugBinaryN13Ast__binary_t1N13Ast__binary_t(v_32->u.AUG_BINOP, &v_35), _fx_catch_11);
            FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_31->t1, &v_36, 0), _fx_catch_11);
            FX_CALL(
               _fx_M3AstFM9ExpBinaryN10Ast__exp_t4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(v_35, e1_0,
                  e2_1, &v_36, &v_37), _fx_catch_11);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_10, v_37, fx_result);

         _fx_catch_11: ;
            if (v_37) {
               _fx_free_N10Ast__exp_t(&v_37);
            }
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_36);
            if (v_35) {
               _fx_free_N13Ast__binary_t(&v_35);
            }
            if (e2_1) {
               _fx_free_N10Ast__exp_t(&e2_1);
            }
            if (ts_10) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_10);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_34);
            fx_free_exn(&v_33);
            goto _fx_endmatch_4;
         }
      }
      if (ts_8 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_38 = ts_8->tl;
         if (v_38 != 0) {
            if (v_38->hd.t0.tag == 49) {
               _fx_T2N14Lexer__token_tR10Ast__loc_t* v_39 = &ts_8->hd;
               if (v_39->t0.tag == 87) {
                  fx_exn_t v_40 = {0};
                  _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t v_41 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_11 = 0;
                  _fx_LT2R9Ast__id_tN10Ast__exp_t rec_init_elems_0 = 0;
                  _fx_T2N10Ast__typ_tR10Ast__loc_t v_42 = {0};
                  _fx_N10Ast__exp_t v_43 = 0;
                  if (!lvalue_e1_0) {
                     _fx_R10Ast__loc_t loc_3;
                     if (ts_8 != 0) {
                        loc_3 = ts_8->hd.t1;
                     }
                     else {
                        loc_3 = _fx_g18Parser__parser_ctx.default_loc;
                     }
                     FX_CHECK_EXN(_fx_catch_12);
                     fx_str_t slit_3 = FX_MAKE_STR("left-hand-side of the assignment is not an l-value");
                     FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_3, &v_40), _fx_catch_12);
                     FX_THROW(&v_40, true, _fx_catch_12);
                  }
                  FX_CALL(
                     _fx_M6ParserFM14parse_exp_listT4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t5LT2N14Lexer__token_tR10Ast__loc_tN14Lexer__token_tN17Parser__kw_mode_tBB(
                        ts_8, &_fx_g14Parser__RBRACE, &_fx_g14Parser__KwMust, true, false, &v_41, 0), _fx_catch_12);
                  FX_COPY_PTR(v_41.t0, &ts_11);
                  FX_COPY_PTR(v_41.t3, &rec_init_elems_0);
                  FX_CALL(_fx_M3AstFM12make_new_ctxT2N10Ast__typ_tRM5loc_t1RM5loc_t(&v_39->t1, &v_42, 0), _fx_catch_12);
                  FX_CALL(
                     _fx_M3AstFM15ExpUpdateRecordN10Ast__exp_t3N10Ast__exp_tLT2RM4id_tN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(e1_0,
                        rec_init_elems_0, &v_42, &v_43), _fx_catch_12);
                  _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_11, v_43, fx_result);

               _fx_catch_12: ;
                  if (v_43) {
                     _fx_free_N10Ast__exp_t(&v_43);
                  }
                  _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_42);
                  if (rec_init_elems_0) {
                     _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&rec_init_elems_0);
                  }
                  if (ts_11) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_11);
                  }
                  _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_t(&v_41);
                  fx_free_exn(&v_40);
                  goto _fx_endmatch_4;
               }
            }
         }
      }
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_8, e1_0, fx_result);

   _fx_endmatch_4: ;
      FX_CHECK_EXN(_fx_catch_13);

   _fx_catch_13: ;
      if (e1_0) {
         _fx_free_N10Ast__exp_t(&e1_0);
      }
      if (ts_8) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_8);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_26);
      goto _fx_endmatch_5;
   }
   FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);

_fx_endmatch_5: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM14parse_pat_listT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t5LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__pat_tBC(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LN10Ast__pat_t_data_t* result_0,
   bool simple_0,
   char_ rbrace_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__pat_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(result_0, &result_2);
   bool simple_1 = simple_0;
   char_ rbrace_1 = rbrace_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LN10Ast__pat_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(result_2, &result_3);
      bool simple_2 = simple_1;
      char_ rbrace_2 = rbrace_1;
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               _fx_free_LN10Ast__pat_t(&result_2);
               FX_COPY_PTR(result_3, &result_2);
               simple_1 = simple_2;
               rbrace_1 = rbrace_2;
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 46) {
            fx_exn_t v_1 = {0};
            fx_exn_t v_2 = {0};
            _fx_LN10Ast__pat_t __fold_result___0 = 0;
            _fx_LN10Ast__pat_t v_3 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t result_4 = {0};
            if (rbrace_2 != (char_)41) {
               _fx_R10Ast__loc_t loc_1;
               if (ts_2 != 0) {
                  loc_1 = ts_2->hd.t1;
               }
               else {
                  loc_1 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_2);
               fx_str_t slit_1 = FX_MAKE_STR("mismatched closing brace; must be \')\'");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_1), _fx_catch_2);
               FX_THROW(&v_1, true, _fx_catch_2);
            }
            if (result_3 == 0) {
               _fx_R10Ast__loc_t loc_2;
               if (ts_2 != 0) {
                  loc_2 = ts_2->hd.t1;
               }
               else {
                  loc_2 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_2);
               fx_str_t slit_2 = FX_MAKE_STR("empty tuple pattern are not allowed");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_2), _fx_catch_2);
               FX_THROW(&v_2, true, _fx_catch_2);
            }
            _fx_LN10Ast__pat_t lst_0 = result_3;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_LN10Ast__pat_t r_0 = 0;
               _fx_N10Ast__pat_t a_0 = lst_0->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LN10Ast__pat_t(a_0, r_0, false, &r_0), _fx_catch_1);
               _fx_free_LN10Ast__pat_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_1: ;
               if (r_0) {
                  _fx_free_LN10Ast__pat_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_2);
            }
            FX_COPY_PTR(__fold_result___0, &v_3);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(ts_2->tl, v_3, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&result_4, &result_1);
            FX_BREAK(_fx_catch_2);

         _fx_catch_2: ;
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&result_4);
            if (v_3) {
               _fx_free_LN10Ast__pat_t(&v_3);
            }
            if (__fold_result___0) {
               _fx_free_LN10Ast__pat_t(&__fold_result___0);
            }
            fx_free_exn(&v_2);
            fx_free_exn(&v_1);
            goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 48) {
            fx_exn_t v_4 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t result_5 = {0};
            if (rbrace_2 != (char_)93) {
               _fx_R10Ast__loc_t loc_3;
               if (ts_2 != 0) {
                  loc_3 = ts_2->hd.t1;
               }
               else {
                  loc_3 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_3);
               fx_str_t slit_3 = FX_MAKE_STR("mismatched closing brace; must be \')\'");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_3, &v_4), _fx_catch_3);
               FX_THROW(&v_4, true, _fx_catch_3);
            }
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(ts_2->tl, result_3, &result_5);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&result_5, &result_1);
            FX_BREAK(_fx_catch_3);

         _fx_catch_3: ;
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&result_5);
            fx_free_exn(&v_4);
            goto _fx_endmatch_0;
         }
      }
      if (expect_comma_2 == true) {
         fx_exn_t v_5 = {0};
         _fx_R10Ast__loc_t loc_4;
         if (ts_2 != 0) {
            loc_4 = ts_2->hd.t1;
         }
         else {
            loc_4 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_4);
         fx_str_t slit_4 = FX_MAKE_STR("\',\' is expected");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_4, &slit_4, &v_5), _fx_catch_4);
         FX_THROW(&v_5, true, _fx_catch_4);

      _fx_catch_4: ;
         fx_free_exn(&v_5);
         goto _fx_endmatch_0;
      }
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_6 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
      _fx_N10Ast__pat_t p_0 = 0;
      _fx_LN10Ast__pat_t v_7 = 0;
      FX_CALL(
         _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_2,
            simple_2, &v_6, 0), _fx_catch_5);
      FX_COPY_PTR(v_6.t0, &ts_3);
      FX_COPY_PTR(v_6.t1, &p_0);
      FX_CALL(_fx_cons_LN10Ast__pat_t(p_0, result_3, true, &v_7), _fx_catch_5);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
      FX_COPY_PTR(ts_3, &ts_1);
      expect_comma_1 = true;
      _fx_free_LN10Ast__pat_t(&result_2);
      FX_COPY_PTR(v_7, &result_2);
      simple_1 = simple_2;
      rbrace_1 = rbrace_2;

   _fx_catch_5: ;
      if (v_7) {
         _fx_free_LN10Ast__pat_t(&v_7);
      }
      if (p_0) {
         _fx_free_N10Ast__pat_t(&p_0);
      }
      if (ts_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_6);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_6);

   _fx_catch_6: ;
      if (result_3) {
         _fx_free_LN10Ast__pat_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LN10Ast__pat_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM16parse_idpat_listT2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t4LT2N14Lexer__token_tR10Ast__loc_tBLT2R9Ast__id_tN10Ast__pat_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* result_0,
   bool simple_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LT2R9Ast__id_tN10Ast__pat_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(result_0, &result_2);
   bool simple_1 = simple_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT2R9Ast__id_tN10Ast__pat_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(result_2, &result_3);
      bool simple_2 = simple_1;
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&result_2);
               FX_COPY_PTR(result_3, &result_2);
               simple_1 = simple_2;
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_1;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 50) {
            _fx_LT2R9Ast__id_tN10Ast__pat_t __fold_result___0 = 0;
            _fx_LT2R9Ast__id_tN10Ast__pat_t v_1 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t result_4 = {0};
            _fx_LT2R9Ast__id_tN10Ast__pat_t lst_0 = result_3;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_LT2R9Ast__id_tN10Ast__pat_t r_0 = 0;
               _fx_T2R9Ast__id_tN10Ast__pat_t* a_0 = &lst_0->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__pat_t(a_0, r_0, false, &r_0), _fx_catch_1);
               _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_1: ;
               if (r_0) {
                  _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_2);
            }
            FX_COPY_PTR(__fold_result___0, &v_1);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(ts_2->tl, v_1, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(&result_4, &result_1);
            FX_BREAK(_fx_catch_2);

         _fx_catch_2: ;
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(&result_4);
            if (v_1) {
               _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&v_1);
            }
            if (__fold_result___0) {
               _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&__fold_result___0);
            }
            goto _fx_endmatch_1;
         }
      }
      if (expect_comma_2 == true) {
         fx_exn_t v_2 = {0};
         _fx_R10Ast__loc_t loc_1;
         if (ts_2 != 0) {
            loc_1 = ts_2->hd.t1;
         }
         else {
            loc_1 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_3);
         fx_str_t slit_1 = FX_MAKE_STR("\',\' is expected");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_2), _fx_catch_3);
         FX_THROW(&v_2, true, _fx_catch_3);

      _fx_catch_3: ;
         fx_free_exn(&v_2);
         goto _fx_endmatch_1;
      }
      if (ts_2 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_3 = &ts_2->hd;
         _fx_N14Lexer__token_t* v_4 = &v_3->t0;
         if (v_4->tag == 2) {
            fx_exn_t v_5 = {0};
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_6 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
            _fx_N10Ast__pat_t p_0 = 0;
            _fx_T2R9Ast__id_tN10Ast__pat_t v_7 = {0};
            _fx_LT2R9Ast__id_tN10Ast__pat_t v_8 = 0;
            fx_str_t* i__0 = &v_4->u.IDENT.t1;
            _fx_R10Ast__loc_t* l1_0 = &v_3->t1;
            _fx_LT2N14Lexer__token_tR10Ast__loc_t rest_1 = ts_2->tl;
            bool v_9;
            fx_str_t slit_2 = FX_MAKE_STR("_");
            v_9 = _fx_F6__eq__B2SS(i__0, &slit_2, 0);
            if (v_9) {
               fx_str_t slit_3 = FX_MAKE_STR("\'_\' cannot be used as a record elem name");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(l1_0, &slit_3, &v_5), _fx_catch_6);
               FX_THROW(&v_5, true, _fx_catch_6);
            }
            _fx_R9Ast__id_t i_0;
            FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(i__0, &i_0, 0), _fx_catch_6);
            if (rest_1 != 0) {
               if (rest_1->hd.t0.tag == 86) {
                  FX_CALL(
                     _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                        rest_1->tl, simple_2, &v_6, 0), _fx_catch_4);

               _fx_catch_4: ;
                  goto _fx_endmatch_0;
               }
            }
            _fx_N10Ast__pat_t v_10 = 0;
            FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&i_0, l1_0, &v_10), _fx_catch_5);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(rest_1, v_10, &v_6);

         _fx_catch_5: ;
            if (v_10) {
               _fx_free_N10Ast__pat_t(&v_10);
            }

         _fx_endmatch_0: ;
            FX_CHECK_EXN(_fx_catch_6);
            FX_COPY_PTR(v_6.t0, &ts_3);
            FX_COPY_PTR(v_6.t1, &p_0);
            _fx_make_T2R9Ast__id_tN10Ast__pat_t(&i_0, p_0, &v_7);
            FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__pat_t(&v_7, result_3, true, &v_8), _fx_catch_6);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_3, &ts_1);
            expect_comma_1 = true;
            _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&result_2);
            FX_COPY_PTR(v_8, &result_2);
            simple_1 = simple_2;

         _fx_catch_6: ;
            if (v_8) {
               _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&v_8);
            }
            _fx_free_T2R9Ast__id_tN10Ast__pat_t(&v_7);
            if (p_0) {
               _fx_free_N10Ast__pat_t(&p_0);
            }
            if (ts_3) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_6);
            fx_free_exn(&v_5);
            goto _fx_endmatch_1;
         }
      }
      fx_exn_t v_11 = {0};
      _fx_R10Ast__loc_t loc_2;
      if (ts_2 != 0) {
         loc_2 = ts_2->hd.t1;
      }
      else {
         loc_2 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_7);
      fx_str_t slit_4 = FX_MAKE_STR("identifier is expected");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_4, &v_11), _fx_catch_7);
      FX_THROW(&v_11, true, _fx_catch_7);

   _fx_catch_7: ;
      fx_free_exn(&v_11);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_8);

   _fx_catch_8: ;
      if (result_3) {
         _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM15parse_base_pat_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool simple_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_0 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_1 = &v_0->t0;
      if (v_1->tag == 1) {
         fx_exn_t v_2 = {0};
         _fx_N10Ast__pat_t v_3 = 0;
         if (simple_0) {
            _fx_R10Ast__loc_t loc_0;
            if (ts_0 != 0) {
               loc_0 = ts_0->hd.t1;
            }
            else {
               loc_0 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_0);
            fx_str_t slit_0 = FX_MAKE_STR("literals cannot be used in this pattern");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_2), _fx_catch_0);
            FX_THROW(&v_2, true, _fx_catch_0);
         }
         FX_CALL(_fx_M3AstFM6PatLitN10Ast__pat_t2N10Ast__lit_tRM5loc_t(&v_1->u.LITERAL, &v_0->t1, &v_3), _fx_catch_0);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_0->tl, v_3, fx_result);

      _fx_catch_0: ;
         if (v_3) {
            _fx_free_N10Ast__pat_t(&v_3);
         }
         fx_free_exn(&v_2);
         goto _fx_endmatch_2;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_4 = &ts_0->hd;
      if (v_4->t0.tag == 2) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS v_5 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
         fx_str_t i1__0 = {0};
         _fx_R10Ast__loc_t* l1_0 = &v_4->t1;
         fx_str_t slit_1 = FX_MAKE_STR("");
         FX_CALL(
            _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(ts_0, false,
               &slit_1, &v_5, 0), _fx_catch_6);
         FX_COPY_PTR(v_5.t0, &ts_1);
         fx_copy_str(&v_5.t1, &i1__0);
         _fx_R9Ast__id_t i1_0;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&i1__0, &i1_0, 0), _fx_catch_6);
         bool is_any_0;
         fx_str_t slit_2 = FX_MAKE_STR("_");
         is_any_0 = _fx_F6__eq__B2SS(&i1__0, &slit_2, 0);
         if (ts_1 != 0) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_6 = &ts_1->hd;
            _fx_N14Lexer__token_t* v_7 = &v_6->t0;
            if (v_7->tag == 2) {
               fx_exn_t v_8 = {0};
               _fx_N10Ast__pat_t p2_0 = 0;
               _fx_LN10Ast__pat_t v_9 = 0;
               _fx_N10Ast__pat_t v_10 = 0;
               fx_str_t* i2__0 = &v_7->u.IDENT.t1;
               _fx_R10Ast__loc_t* l2_0 = &v_6->t1;
               if (is_any_0) {
                  fx_str_t slit_3 = FX_MAKE_STR("\'_\' cannot be used as a variant label");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(l1_0, &slit_3, &v_8), _fx_catch_1);
                  FX_THROW(&v_8, true, _fx_catch_1);
               }
               bool v_11;
               fx_str_t slit_4 = FX_MAKE_STR("_");
               v_11 = _fx_F6__eq__B2SS(i2__0, &slit_4, 0);
               if (v_11) {
                  FX_CALL(_fx_M3AstFM6PatAnyN10Ast__pat_t1RM5loc_t(l2_0, &p2_0), _fx_catch_1);
               }
               else {
                  _fx_R9Ast__id_t v_12;
                  FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(i2__0, &v_12, 0), _fx_catch_1);
                  FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&v_12, l2_0, &p2_0), _fx_catch_1);
               }
               FX_CALL(_fx_cons_LN10Ast__pat_t(p2_0, 0, true, &v_9), _fx_catch_1);
               FX_CALL(_fx_M3AstFM10PatVariantN10Ast__pat_t3RM4id_tLN10Ast__pat_tRM5loc_t(&i1_0, v_9, l1_0, &v_10),
                  _fx_catch_1);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_1->tl, v_10, fx_result);

            _fx_catch_1: ;
               if (v_10) {
                  _fx_free_N10Ast__pat_t(&v_10);
               }
               if (v_9) {
                  _fx_free_LN10Ast__pat_t(&v_9);
               }
               if (p2_0) {
                  _fx_free_N10Ast__pat_t(&p2_0);
               }
               fx_free_exn(&v_8);
               goto _fx_endmatch_0;
            }
         }
         if (ts_1 != 0) {
            _fx_T2N14Lexer__token_tR10Ast__loc_t* v_13 = &ts_1->hd;
            _fx_N14Lexer__token_t* v_14 = &v_13->t0;
            if (v_14->tag == 1) {
               fx_exn_t v_15 = {0};
               fx_exn_t v_16 = {0};
               _fx_N10Ast__pat_t v_17 = 0;
               _fx_LN10Ast__pat_t v_18 = 0;
               _fx_N10Ast__pat_t v_19 = 0;
               if (is_any_0) {
                  fx_str_t slit_5 = FX_MAKE_STR("\'_\' cannot be used as a variant label");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(l1_0, &slit_5, &v_15), _fx_catch_2);
                  FX_THROW(&v_15, true, _fx_catch_2);
               }
               if (simple_0) {
                  _fx_R10Ast__loc_t loc_1;
                  if (ts_1 != 0) {
                     loc_1 = ts_1->hd.t1;
                  }
                  else {
                     loc_1 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_2);
                  fx_str_t slit_6 = FX_MAKE_STR("literals cannot be used in this pattern");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_6, &v_16), _fx_catch_2);
                  FX_THROW(&v_16, true, _fx_catch_2);
               }
               FX_CALL(_fx_M3AstFM6PatLitN10Ast__pat_t2N10Ast__lit_tRM5loc_t(&v_14->u.LITERAL, &v_13->t1, &v_17), _fx_catch_2);
               FX_CALL(_fx_cons_LN10Ast__pat_t(v_17, 0, true, &v_18), _fx_catch_2);
               FX_CALL(_fx_M3AstFM10PatVariantN10Ast__pat_t3RM4id_tLN10Ast__pat_tRM5loc_t(&i1_0, v_18, l1_0, &v_19),
                  _fx_catch_2);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_1->tl, v_19, fx_result);

            _fx_catch_2: ;
               if (v_19) {
                  _fx_free_N10Ast__pat_t(&v_19);
               }
               if (v_18) {
                  _fx_free_LN10Ast__pat_t(&v_18);
               }
               if (v_17) {
                  _fx_free_N10Ast__pat_t(&v_17);
               }
               fx_free_exn(&v_16);
               fx_free_exn(&v_15);
               goto _fx_endmatch_0;
            }
         }
         if (ts_1 != 0) {
            _fx_N14Lexer__token_t* v_20 = &ts_1->hd.t0;
            if (v_20->tag == 44) {
               if (v_20->u.LPAREN == false) {
                  fx_exn_t v_21 = {0};
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t v_22 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
                  _fx_LN10Ast__pat_t pl_0 = 0;
                  _fx_N10Ast__pat_t v_23 = 0;
                  if (is_any_0) {
                     fx_str_t slit_7 = FX_MAKE_STR("\'_\' cannot be used as a variant label");
                     FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(l1_0, &slit_7, &v_21), _fx_catch_3);
                     FX_THROW(&v_21, true, _fx_catch_3);
                  }
                  FX_CALL(
                     _fx_M6ParserFM14parse_pat_listT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t5LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__pat_tBC(
                        ts_1->tl, false, 0, simple_0, (char_)41, &v_22, 0), _fx_catch_3);
                  FX_COPY_PTR(v_22.t0, &ts_2);
                  FX_COPY_PTR(v_22.t1, &pl_0);
                  FX_CALL(_fx_M3AstFM10PatVariantN10Ast__pat_t3RM4id_tLN10Ast__pat_tRM5loc_t(&i1_0, pl_0, l1_0, &v_23),
                     _fx_catch_3);
                  _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_2, v_23, fx_result);

               _fx_catch_3: ;
                  if (v_23) {
                     _fx_free_N10Ast__pat_t(&v_23);
                  }
                  if (pl_0) {
                     _fx_free_LN10Ast__pat_t(&pl_0);
                  }
                  if (ts_2) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&v_22);
                  fx_free_exn(&v_21);
                  goto _fx_endmatch_0;
               }
            }
         }
         if (ts_1 != 0) {
            if (ts_1->hd.t0.tag == 49) {
               fx_exn_t v_24 = {0};
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t v_25 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
               _fx_LT2R9Ast__id_tN10Ast__pat_t ipl_0 = 0;
               _fx_N10Ast__pat_t v_26 = 0;
               if (is_any_0) {
                  fx_str_t slit_8 = FX_MAKE_STR("\'_\' cannot be used as a variant label");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(l1_0, &slit_8, &v_24), _fx_catch_4);
                  FX_THROW(&v_24, true, _fx_catch_4);
               }
               FX_CALL(
                  _fx_M6ParserFM16parse_idpat_listT2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t4LT2N14Lexer__token_tR10Ast__loc_tBLT2R9Ast__id_tN10Ast__pat_tB(
                     ts_1->tl, false, 0, simple_0, &v_25, 0), _fx_catch_4);
               FX_COPY_PTR(v_25.t0, &ts_3);
               FX_COPY_PTR(v_25.t1, &ipl_0);
               _fx_Nt6option1R9Ast__id_t v_27;
               _fx_M6ParserFM4SomeNt6option1R9Ast__id_t1R9Ast__id_t(&i1_0, &v_27);
               FX_CALL(
                  _fx_M3AstFM9PatRecordN10Ast__pat_t3Nt6option1RM4id_tLT2RM4id_tN10Ast__pat_tRM5loc_t(&v_27, ipl_0, l1_0,
                     &v_26), _fx_catch_4);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_3, v_26, fx_result);

            _fx_catch_4: ;
               if (v_26) {
                  _fx_free_N10Ast__pat_t(&v_26);
               }
               if (ipl_0) {
                  _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&ipl_0);
               }
               if (ts_3) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(&v_25);
               fx_free_exn(&v_24);
               goto _fx_endmatch_0;
            }
         }
         _fx_N10Ast__pat_t v_28 = 0;
         _fx_N10Ast__pat_t v_29 = 0;
         _fx_N10Ast__pat_t v_30 = 0;
         if (is_any_0) {
            FX_CALL(_fx_M3AstFM6PatAnyN10Ast__pat_t1RM5loc_t(l1_0, &v_28), _fx_catch_5);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_1, v_28, fx_result);
         }
         else {
            FX_STR_CHKIDX(i1__0, 0, _fx_catch_5);
            char_ c_0 = FX_STR_ELEM(i1__0, 0);
            bool v_31;
            bool t_0;
            if ((bool)(((char_)65 <= c_0) & (c_0 <= (char_)90))) {
               t_0 = true;
            }
            else {
               t_0 = _fx_M6StringFM8containsB2SC(&i1__0, (char_)46, 0);
            }
            if (t_0) {
               if (!simple_0) {
                  v_31 = true;
               }
               else {
                  v_31 = _fx_M6StringFM8containsB2SC(&i1__0, (char_)46, 0);
               }
            }
            else {
               v_31 = false;
            }
            if (v_31) {
               FX_CALL(_fx_M3AstFM10PatVariantN10Ast__pat_t3RM4id_tLN10Ast__pat_tRM5loc_t(&i1_0, 0, l1_0, &v_29), _fx_catch_5);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_1, v_29, fx_result);
            }
            else {
               FX_CALL(_fx_M3AstFM8PatIdentN10Ast__pat_t2RM4id_tRM5loc_t(&i1_0, l1_0, &v_30), _fx_catch_5);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_1, v_30, fx_result);
            }
         }

      _fx_catch_5: ;
         if (v_30) {
            _fx_free_N10Ast__pat_t(&v_30);
         }
         if (v_29) {
            _fx_free_N10Ast__pat_t(&v_29);
         }
         if (v_28) {
            _fx_free_N10Ast__pat_t(&v_28);
         }

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_6);

      _fx_catch_6: ;
         FX_FREE_STR(&i1__0);
         if (ts_1) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&v_5);
         goto _fx_endmatch_2;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_32 = &ts_0->hd;
      if (v_32->t0.tag == 44) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t v_33 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_LN10Ast__pat_t pl_1 = 0;
         _fx_N10Ast__pat_t v_34 = 0;
         FX_CALL(
            _fx_M6ParserFM14parse_pat_listT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t5LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__pat_tBC(
               ts_0->tl, false, 0, simple_0, (char_)41, &v_33, 0), _fx_catch_8);
         FX_COPY_PTR(v_33.t0, &ts_4);
         FX_COPY_PTR(v_33.t1, &pl_1);
         if (pl_1 != 0) {
            if (pl_1->tl == 0) {
               FX_COPY_PTR(pl_1->hd, &v_34); goto _fx_endmatch_1;
            }
         }
         FX_CALL(_fx_M3AstFM8PatTupleN10Ast__pat_t2LN10Ast__pat_tRM5loc_t(pl_1, &v_32->t1, &v_34), _fx_catch_7);

      _fx_catch_7: ;

      _fx_endmatch_1: ;
         FX_CHECK_EXN(_fx_catch_8);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_4, v_34, fx_result);

      _fx_catch_8: ;
         if (v_34) {
            _fx_free_N10Ast__pat_t(&v_34);
         }
         if (pl_1) {
            _fx_free_LN10Ast__pat_t(&pl_1);
         }
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&v_33);
         goto _fx_endmatch_2;
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_35 = ts_0->tl;
      if (v_35 != 0) {
         if (v_35->hd.t0.tag == 56) {
            if (ts_0->hd.t0.tag == 47) {
               fx_exn_t v_36 = {0};
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t v_37 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
               _fx_LN10Ast__pat_t pl_2 = 0;
               _fx_N10Ast__pat_t v_38 = 0;
               _fx_N10Ast__pat_t __fold_result___0 = 0;
               if (simple_0) {
                  _fx_R10Ast__loc_t loc_2;
                  if (ts_0 != 0) {
                     loc_2 = ts_0->hd.t1;
                  }
                  else {
                     loc_2 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_10);
                  fx_str_t slit_9 = FX_MAKE_STR("list pattern cannot be used here");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_9, &v_36), _fx_catch_10);
                  FX_THROW(&v_36, true, _fx_catch_10);
               }
               FX_CALL(
                  _fx_M6ParserFM14parse_pat_listT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t5LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__pat_tBC(
                     v_35->tl, false, 0, simple_0, (char_)93, &v_37, 0), _fx_catch_10);
               FX_COPY_PTR(v_37.t0, &ts_5);
               FX_COPY_PTR(v_37.t1, &pl_2);
               if (pl_2 != 0) {
                  FX_COPY_PTR(pl_2->hd, &v_38);
               }
               else {
                  FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_10);
               }
               FX_CHECK_EXN(_fx_catch_10);
               _fx_R10Ast__loc_t v_39;
               FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(v_38, &v_39, 0), _fx_catch_10);
               FX_CALL(
                  _fx_M3AstFM6PatLitN10Ast__pat_t2N10Ast__lit_tRM5loc_t(&_fx_g16Parser__LitEmpty, &v_39, &__fold_result___0),
                  _fx_catch_10);
               _fx_LN10Ast__pat_t lst_0 = pl_2;
               for (; lst_0; lst_0 = lst_0->tl) {
                  _fx_N10Ast__pat_t tail_0 = 0;
                  _fx_LR10Ast__loc_t v_40 = 0;
                  _fx_N10Ast__pat_t v_41 = 0;
                  _fx_N10Ast__pat_t p_0 = lst_0->hd;
                  FX_COPY_PTR(__fold_result___0, &tail_0);
                  _fx_R10Ast__loc_t v_42;
                  FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(p_0, &v_42, 0), _fx_catch_9);
                  _fx_R10Ast__loc_t v_43;
                  FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(tail_0, &v_43, 0), _fx_catch_9);
                  FX_CALL(_fx_cons_LR10Ast__loc_t(&v_43, 0, true, &v_40), _fx_catch_9);
                  FX_CALL(_fx_cons_LR10Ast__loc_t(&v_42, v_40, false, &v_40), _fx_catch_9);
                  _fx_R10Ast__loc_t v_44;
                  FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(v_40, &_fx_g10Ast__noloc, &v_44, 0), _fx_catch_9);
                  FX_CALL(_fx_M3AstFM7PatConsN10Ast__pat_t3N10Ast__pat_tN10Ast__pat_tRM5loc_t(p_0, tail_0, &v_44, &v_41),
                     _fx_catch_9);
                  _fx_free_N10Ast__pat_t(&__fold_result___0);
                  FX_COPY_PTR(v_41, &__fold_result___0);

               _fx_catch_9: ;
                  if (v_41) {
                     _fx_free_N10Ast__pat_t(&v_41);
                  }
                  FX_FREE_LIST_SIMPLE(&v_40);
                  if (tail_0) {
                     _fx_free_N10Ast__pat_t(&tail_0);
                  }
                  FX_CHECK_EXN(_fx_catch_10);
               }
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_5, __fold_result___0, fx_result);

            _fx_catch_10: ;
               if (__fold_result___0) {
                  _fx_free_N10Ast__pat_t(&__fold_result___0);
               }
               if (v_38) {
                  _fx_free_N10Ast__pat_t(&v_38);
               }
               if (pl_2) {
                  _fx_free_LN10Ast__pat_t(&pl_2);
               }
               if (ts_5) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_t(&v_37);
               fx_free_exn(&v_36);
               goto _fx_endmatch_2;
            }
         }
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_45 = &ts_0->hd;
      if (v_45->t0.tag == 49) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t v_46 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
         _fx_LT2R9Ast__id_tN10Ast__pat_t ipl_1 = 0;
         _fx_N10Ast__pat_t v_47 = 0;
         FX_CALL(
            _fx_M6ParserFM16parse_idpat_listT2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t4LT2N14Lexer__token_tR10Ast__loc_tBLT2R9Ast__id_tN10Ast__pat_tB(
               ts_0->tl, false, 0, simple_0, &v_46, 0), _fx_catch_11);
         FX_COPY_PTR(v_46.t0, &ts_6);
         FX_COPY_PTR(v_46.t1, &ipl_1);
         FX_CALL(
            _fx_M3AstFM9PatRecordN10Ast__pat_t3Nt6option1RM4id_tLT2RM4id_tN10Ast__pat_tRM5loc_t(&_fx_g14Parser__None1_, ipl_1,
               &v_45->t1, &v_47), _fx_catch_11);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_6, v_47, fx_result);

      _fx_catch_11: ;
         if (v_47) {
            _fx_free_N10Ast__pat_t(&v_47);
         }
         if (ipl_1) {
            _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&ipl_1);
         }
         if (ts_6) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__pat_t(&v_46);
         goto _fx_endmatch_2;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_48 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_49 = &v_48->t0;
      if (v_49->tag == 33) {
         if (v_49->u.REF == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_50 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_7 = 0;
            _fx_N10Ast__pat_t p_1 = 0;
            _fx_N10Ast__pat_t v_51 = 0;
            FX_CALL(
               _fx_M6ParserFM15parse_base_pat_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                  ts_0->tl, simple_0, &v_50, 0), _fx_catch_12);
            FX_COPY_PTR(v_50.t0, &ts_7);
            FX_COPY_PTR(v_50.t1, &p_1);
            FX_CALL(_fx_M3AstFM6PatRefN10Ast__pat_t2N10Ast__pat_tRM5loc_t(p_1, &v_48->t1, &v_51), _fx_catch_12);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_7, v_51, fx_result);

         _fx_catch_12: ;
            if (v_51) {
               _fx_free_N10Ast__pat_t(&v_51);
            }
            if (p_1) {
               _fx_free_N10Ast__pat_t(&p_1);
            }
            if (ts_7) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_7);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_50);
            goto _fx_endmatch_2;
         }
      }
   }
   fx_exn_t v_52 = {0};
   _fx_R10Ast__loc_t loc_3;
   if (ts_0 != 0) {
      loc_3 = ts_0->hd.t1;
   }
   else {
      loc_3 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_13);
   fx_str_t slit_10 = FX_MAKE_STR("pattern is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_10, &v_52), _fx_catch_13);
   FX_THROW(&v_52, true, _fx_catch_13);

_fx_catch_13: ;
   fx_free_exn(&v_52);

_fx_endmatch_2: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM11extend_pat_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tiB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N10Ast__pat_t_data_t* result_0,
   int_ min_prec_0,
   bool simple_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__pat_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(result_0, &result_2);
   int_ min_prec_1 = min_prec_0;
   bool simple_1 = simple_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_N10Ast__pat_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(result_2, &result_3);
      int_ min_prec_2 = min_prec_1;
      bool simple_2 = simple_1;
      if (ts_2 != 0) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t result_4 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t rest_0 = ts_2->tl;
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_0 = &ts_2->hd;
         _fx_R10Ast__loc_t* l_0 = &v_0->t1;
         _fx_N14Lexer__token_t* t_0 = &v_0->t0;
         int tag_0 = t_0->tag;
         _fx_T2iN15Ast__op_assoc_t v_1;
         if (tag_0 == 40) {
            _fx_T2iN15Ast__op_assoc_t tup_0 = { 40, _fx_g17Parser__AssocLeft }; v_1 = tup_0;
         }
         else if (tag_0 == 56) {
            _fx_T2iN15Ast__op_assoc_t tup_1 = { 50, _fx_g18Parser__AssocRight }; v_1 = tup_1;
         }
         else if (tag_0 == 5) {
            _fx_T2iN15Ast__op_assoc_t tup_2 = { 60, _fx_g17Parser__AssocLeft }; v_1 = tup_2;
         }
         else if (tag_0 == 54) {
            _fx_T2iN15Ast__op_assoc_t tup_3 = { 70, _fx_g17Parser__AssocLeft }; v_1 = tup_3;
         }
         else {
            _fx_T2iN15Ast__op_assoc_t tup_4 = { -1, _fx_g17Parser__AssocLeft }; v_1 = tup_4;
         }
         FX_CHECK_EXN(_fx_catch_7);
         int_ prec_0 = v_1.t0;
         _fx_N15Ast__op_assoc_t assoc_0 = v_1.t1;
         if (prec_0 < min_prec_2) {
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_2, result_3, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_4, &result_1);
            FX_BREAK(_fx_catch_7);
         }
         else {
            int_ next_min_prec_0;
            if (assoc_0.tag == 1) {
               next_min_prec_0 = prec_0 + 1;
            }
            else {
               next_min_prec_0 = prec_0;
            }
            FX_CHECK_EXN(_fx_catch_7);
            int tag_1 = t_0->tag;
            if (tag_1 == 40) {
               fx_exn_t v_2 = {0};
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_3 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
               _fx_N10Ast__exp_t e_0 = 0;
               _fx_N10Ast__pat_t v_4 = 0;
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t result_5 = {0};
               if (simple_2) {
                  _fx_R10Ast__loc_t loc_0;
                  if (ts_2 != 0) {
                     loc_0 = ts_2->hd.t1;
                  }
                  else {
                     loc_0 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_0);
                  fx_str_t slit_0 = FX_MAKE_STR("when-patterns are not allowed here");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_2), _fx_catch_0);
                  FX_THROW(&v_2, true, _fx_catch_0);
               }
               FX_CALL(
                  _fx_M6ParserFM17parse_complex_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
                     rest_0, &v_3, 0), _fx_catch_0);
               FX_COPY_PTR(v_3.t0, &ts_3);
               FX_COPY_PTR(v_3.t1, &e_0);
               FX_CALL(_fx_M3AstFM7PatWhenN10Ast__pat_t3N10Ast__pat_tN10Ast__exp_tRM5loc_t(result_3, e_0, l_0, &v_4),
                  _fx_catch_0);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_3, v_4, &result_5);
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_1);
               _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_5, &result_1);
               FX_BREAK(_fx_catch_0);

            _fx_catch_0: ;
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_5);
               if (v_4) {
                  _fx_free_N10Ast__pat_t(&v_4);
               }
               if (e_0) {
                  _fx_free_N10Ast__exp_t(&e_0);
               }
               if (ts_3) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_3);
               fx_free_exn(&v_2);
            }
            else if (tag_1 == 5) {
               if (rest_0 != 0) {
                  _fx_N14Lexer__token_t* v_5 = &rest_0->hd.t0;
                  if (v_5->tag == 2) {
                     _fx_N10Ast__pat_t v_6 = 0;
                     _fx_R9Ast__id_t v_7;
                     FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_5->u.IDENT.t1, &v_7, 0), _fx_catch_1);
                     FX_CALL(_fx_M3AstFM5PatAsN10Ast__pat_t3N10Ast__pat_tRM4id_tRM5loc_t(result_3, &v_7, l_0, &v_6),
                        _fx_catch_1);
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &rest_0->tl;
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                     FX_COPY_PTR(*rest_1, &ts_1);
                     _fx_free_N10Ast__pat_t(&result_2);
                     FX_COPY_PTR(v_6, &result_2);
                     min_prec_1 = min_prec_2;
                     simple_1 = simple_2;

                  _fx_catch_1: ;
                     if (v_6) {
                        _fx_free_N10Ast__pat_t(&v_6);
                     }
                     goto _fx_endmatch_0;
                  }
               }
               fx_exn_t v_8 = {0};
               _fx_R10Ast__loc_t loc_1;
               if (ts_2 != 0) {
                  loc_1 = ts_2->hd.t1;
               }
               else {
                  loc_1 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_2);
               fx_str_t slit_1 = FX_MAKE_STR("identifier is expected");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_8), _fx_catch_2);
               FX_THROW(&v_8, true, _fx_catch_2);

            _fx_catch_2: ;
               fx_free_exn(&v_8);

            _fx_endmatch_0: ;
               FX_CHECK_EXN(_fx_catch_3);

            _fx_catch_3: ;
            }
            else if (tag_1 == 54) {
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_9 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
               _fx_N10Ast__typ_t t_1 = 0;
               _fx_N10Ast__pat_t v_10 = 0;
               FX_CALL(
                  _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
                     rest_0, &v_9, 0), _fx_catch_4);
               FX_COPY_PTR(v_9.t0, &ts_4);
               FX_COPY_PTR(v_9.t1, &t_1);
               FX_CALL(_fx_M3AstFM8PatTypedN10Ast__pat_t3N10Ast__pat_tN10Ast__typ_tRM5loc_t(result_3, t_1, l_0, &v_10),
                  _fx_catch_4);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(ts_4, &ts_1);
               _fx_free_N10Ast__pat_t(&result_2);
               FX_COPY_PTR(v_10, &result_2);
               min_prec_1 = min_prec_2;
               simple_1 = simple_2;

            _fx_catch_4: ;
               if (v_10) {
                  _fx_free_N10Ast__pat_t(&v_10);
               }
               if (t_1) {
                  _fx_free_N10Ast__typ_t(&t_1);
               }
               if (ts_4) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_9);
            }
            else if (tag_1 == 56) {
               fx_exn_t v_11 = {0};
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_12 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
               _fx_N10Ast__pat_t p2_0 = 0;
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_13 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
               _fx_N10Ast__pat_t p2_1 = 0;
               _fx_N10Ast__pat_t v_14 = 0;
               if (simple_2) {
                  _fx_R10Ast__loc_t loc_2;
                  if (ts_2 != 0) {
                     loc_2 = ts_2->hd.t1;
                  }
                  else {
                     loc_2 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_5);
                  fx_str_t slit_2 = FX_MAKE_STR("\'::\'-patterns are not allowed here");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_11), _fx_catch_5);
                  FX_THROW(&v_11, true, _fx_catch_5);
               }
               FX_CALL(
                  _fx_M6ParserFM15parse_base_pat_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                     rest_0, simple_2, &v_12, 0), _fx_catch_5);
               FX_COPY_PTR(v_12.t0, &ts_5);
               FX_COPY_PTR(v_12.t1, &p2_0);
               FX_CALL(
                  _fx_M6ParserFM11extend_pat_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tiB(
                     ts_5, p2_0, next_min_prec_0, simple_2, &v_13, 0), _fx_catch_5);
               FX_COPY_PTR(v_13.t0, &ts_6);
               FX_COPY_PTR(v_13.t1, &p2_1);
               FX_CALL(_fx_M3AstFM7PatConsN10Ast__pat_t3N10Ast__pat_tN10Ast__pat_tRM5loc_t(result_3, p2_1, l_0, &v_14),
                  _fx_catch_5);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(ts_6, &ts_1);
               _fx_free_N10Ast__pat_t(&result_2);
               FX_COPY_PTR(v_14, &result_2);
               min_prec_1 = min_prec_2;
               simple_1 = simple_2;

            _fx_catch_5: ;
               if (v_14) {
                  _fx_free_N10Ast__pat_t(&v_14);
               }
               if (p2_1) {
                  _fx_free_N10Ast__pat_t(&p2_1);
               }
               if (ts_6) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_13);
               if (p2_0) {
                  _fx_free_N10Ast__pat_t(&p2_0);
               }
               if (ts_5) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_12);
               fx_free_exn(&v_11);
            }
            else {
               fx_exn_t v_15 = {0};
               _fx_R10Ast__loc_t loc_3;
               if (ts_2 != 0) {
                  loc_3 = ts_2->hd.t1;
               }
               else {
                  loc_3 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_6);
               fx_str_t slit_3 = FX_MAKE_STR("unxpected token");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_3, &v_15), _fx_catch_6);
               FX_THROW(&v_15, true, _fx_catch_6);

            _fx_catch_6: ;
               fx_free_exn(&v_15);
            }
            FX_CHECK_EXN(_fx_catch_7);
         }

      _fx_catch_7: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_4);
      }
      else {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t result_6 = {0};
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_2, result_3, &result_6);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_6, &result_1);
         FX_BREAK(_fx_catch_8);

      _fx_catch_8: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_6);
      }
      FX_CHECK_EXN(_fx_catch_9);

   _fx_catch_9: ;
      if (result_3) {
         _fx_free_N10Ast__pat_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_N10Ast__pat_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM10parse_alt_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t4LT2N14Lexer__token_tR10Ast__loc_tBBLN10Ast__pat_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_bar_0,
   bool simple_0,
   struct _fx_LN10Ast__pat_t_data_t* result_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__pat_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_bar_1 = expect_bar_0;
   bool simple_1 = simple_0;
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LN10Ast__pat_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_bar_2 = expect_bar_1;
      bool simple_2 = simple_1;
      FX_COPY_PTR(result_2, &result_3);
      bool res_0;
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 55) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 81) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      res_0 = false;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_7);
      if (res_0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_0 = 0;
         fx_exn_t v_1 = {0};
         if (expect_bar_2) {
            if (ts_2 != 0) {
               FX_COPY_PTR(ts_2->tl, &v_0);
            }
            else {
               FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_0);
            }
            FX_CHECK_EXN(_fx_catch_0);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(v_0, &ts_1);
            expect_bar_1 = false;
            simple_1 = simple_2;
            _fx_free_LN10Ast__pat_t(&result_2);
            FX_COPY_PTR(result_3, &result_2);
         }
         else {
            _fx_R10Ast__loc_t loc_0;
            if (ts_2 != 0) {
               loc_0 = ts_2->hd.t1;
            }
            else {
               loc_0 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_0);
            fx_str_t slit_0 = FX_MAKE_STR("extra \'|\'?");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_1), _fx_catch_0);
            FX_THROW(&v_1, true, _fx_catch_0);
         }

      _fx_catch_0: ;
         fx_free_exn(&v_1);
         if (v_0) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_0);
         }
         goto _fx_endmatch_3;
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 61) {
            fx_exn_t v_2 = {0};
            _fx_R10Ast__loc_t loc_1;
            if (ts_2 != 0) {
               loc_1 = ts_2->hd.t1;
            }
            else {
               loc_1 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_1);
            fx_str_t slit_1 = FX_MAKE_STR("unexpected \'->\', did you mean \'=>\'?");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_2), _fx_catch_1);
            FX_THROW(&v_2, true, _fx_catch_1);

         _fx_catch_1: ;
            fx_free_exn(&v_2);
            goto _fx_endmatch_3;
         }
      }
      bool res_1;
      if (expect_bar_2 == true) {
         if (ts_2 != 0) {
            if (ts_2->hd.t0.tag == 60) {
               res_1 = true; goto _fx_endmatch_1;
            }
         }
      }
      if (expect_bar_2 == true) {
         if (ts_2 != 0) {
            if (ts_2->hd.t0.tag == 51) {
               res_1 = true; goto _fx_endmatch_1;
            }
         }
      }
      if (expect_bar_2 == true) {
         if (ts_2 != 0) {
            if (ts_2->hd.t0.tag == 46) {
               res_1 = true; goto _fx_endmatch_1;
            }
         }
      }
      if (expect_bar_2 == true) {
         if (ts_2 != 0) {
            if (ts_2->hd.t0.tag == 48) {
               res_1 = true; goto _fx_endmatch_1;
            }
         }
      }
      if (expect_bar_2 == true) {
         if (ts_2 != 0) {
            if (ts_2->hd.t0.tag == 50) {
               res_1 = true; goto _fx_endmatch_1;
            }
         }
      }
      res_1 = false;

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_7);
      if (res_1) {
         _fx_N10Ast__pat_t p_0 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t result_4 = {0};
         if (result_3 != 0) {
            if (result_3->tl == 0) {
               FX_COPY_PTR(result_3->hd, &p_0); goto _fx_endmatch_2;
            }
         }
         _fx_LN10Ast__pat_t __fold_result___0 = 0;
         _fx_LN10Ast__pat_t result_5 = 0;
         _fx_N10Ast__pat_t v_3 = 0;
         _fx_LN10Ast__pat_t lst_0 = result_3;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_LN10Ast__pat_t r_0 = 0;
            _fx_N10Ast__pat_t a_0 = lst_0->hd;
            FX_COPY_PTR(__fold_result___0, &r_0);
            FX_CALL(_fx_cons_LN10Ast__pat_t(a_0, r_0, false, &r_0), _fx_catch_2);
            _fx_free_LN10Ast__pat_t(&__fold_result___0);
            FX_COPY_PTR(r_0, &__fold_result___0);

         _fx_catch_2: ;
            if (r_0) {
               _fx_free_LN10Ast__pat_t(&r_0);
            }
            FX_CHECK_EXN(_fx_catch_3);
         }
         FX_COPY_PTR(__fold_result___0, &result_5);
         if (result_5 != 0) {
            FX_COPY_PTR(result_5->hd, &v_3);
         }
         else {
            FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_3);
         }
         FX_CHECK_EXN(_fx_catch_3);
         _fx_R10Ast__loc_t v_4;
         FX_CALL(_fx_M3AstFM11get_pat_locRM5loc_t1N10Ast__pat_t(v_3, &v_4, 0), _fx_catch_3);
         FX_CALL(_fx_M3AstFM6PatAltN10Ast__pat_t2LN10Ast__pat_tRM5loc_t(result_5, &v_4, &p_0), _fx_catch_3);

      _fx_catch_3: ;
         if (v_3) {
            _fx_free_N10Ast__pat_t(&v_3);
         }
         if (result_5) {
            _fx_free_LN10Ast__pat_t(&result_5);
         }
         if (__fold_result___0) {
            _fx_free_LN10Ast__pat_t(&__fold_result___0);
         }

      _fx_endmatch_2: ;
         FX_CHECK_EXN(_fx_catch_4);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_2, p_0, &result_4);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_4, &result_1);
         FX_BREAK(_fx_catch_4);

      _fx_catch_4: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_4);
         if (p_0) {
            _fx_free_N10Ast__pat_t(&p_0);
         }
         goto _fx_endmatch_3;
      }
      if (expect_bar_2 == false) {
         if (ts_2 != 0) {
            if (ts_2->hd.t0.tag == 60) {
               fx_exn_t v_5 = {0};
               _fx_R10Ast__loc_t loc_2;
               if (ts_2 != 0) {
                  loc_2 = ts_2->hd.t1;
               }
               else {
                  loc_2 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_5);
               fx_str_t slit_2 = FX_MAKE_STR("pattern is expected");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_5), _fx_catch_5);
               FX_THROW(&v_5, true, _fx_catch_5);

            _fx_catch_5: ;
               fx_free_exn(&v_5);
               goto _fx_endmatch_3;
            }
         }
      }
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_6 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
      _fx_N10Ast__pat_t p_1 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_7 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
      _fx_N10Ast__pat_t p_2 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t result_6 = {0};
      _fx_LN10Ast__pat_t v_8 = 0;
      FX_CALL(
         _fx_M6ParserFM15parse_base_pat_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(
            ts_2, simple_2, &v_6, 0), _fx_catch_6);
      FX_COPY_PTR(v_6.t0, &ts_3);
      FX_COPY_PTR(v_6.t1, &p_1);
      FX_CALL(
         _fx_M6ParserFM11extend_pat_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t4LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_tiB(
            ts_3, p_1, 0, simple_2, &v_7, 0), _fx_catch_6);
      FX_COPY_PTR(v_7.t0, &ts_4);
      FX_COPY_PTR(v_7.t1, &p_2);
      if (simple_2) {
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(ts_4, p_2, &result_6);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_6, &result_1);
         FX_BREAK(_fx_catch_6);
      }
      else {
         FX_CALL(_fx_cons_LN10Ast__pat_t(p_2, result_3, true, &v_8), _fx_catch_6);
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         FX_COPY_PTR(ts_4, &ts_1);
         expect_bar_1 = true;
         simple_1 = simple_2;
         _fx_free_LN10Ast__pat_t(&result_2);
         FX_COPY_PTR(v_8, &result_2);
      }

   _fx_catch_6: ;
      if (v_8) {
         _fx_free_LN10Ast__pat_t(&v_8);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_6);
      if (p_2) {
         _fx_free_N10Ast__pat_t(&p_2);
      }
      if (ts_4) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_7);
      if (p_1) {
         _fx_free_N10Ast__pat_t(&p_1);
      }
      if (ts_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_6);

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_7);

   _fx_catch_7: ;
      if (result_3) {
         _fx_free_LN10Ast__pat_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LN10Ast__pat_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool simple_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM10parse_alt_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t4LT2N14Lexer__token_tR10Ast__loc_tBBLN10Ast__pat_t(
         ts_0, false, simple_0, 0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM19extend_match_cases_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* result_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LT2N10Ast__pat_tN10Ast__exp_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT2N10Ast__pat_tN10Ast__exp_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(result_2, &result_3);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 50) {
            fx_exn_t v_0 = {0};
            _fx_LT2N10Ast__pat_tN10Ast__exp_t __fold_result___0 = 0;
            _fx_LT2N10Ast__pat_tN10Ast__exp_t v_1 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t result_4 = {0};
            if (result_3 == 0) {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_1);
               fx_str_t slit_0 = FX_MAKE_STR("at least one pattern-matching case is expected");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_1);
               FX_THROW(&v_0, true, _fx_catch_1);
            }
            _fx_LT2N10Ast__pat_tN10Ast__exp_t lst_0 = result_3;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_LT2N10Ast__pat_tN10Ast__exp_t r_0 = 0;
               _fx_T2N10Ast__pat_tN10Ast__exp_t* a_0 = &lst_0->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(a_0, r_0, false, &r_0), _fx_catch_0);
               _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_0: ;
               if (r_0) {
                  _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_1);
            }
            FX_COPY_PTR(__fold_result___0, &v_1);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(ts_2->tl, v_1, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(&result_4, &result_1);
            FX_BREAK(_fx_catch_1);

         _fx_catch_1: ;
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(&result_4);
            if (v_1) {
               _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&v_1);
            }
            if (__fold_result___0) {
               _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&__fold_result___0);
            }
            fx_free_exn(&v_0);
            goto _fx_endmatch_4;
         }
      }
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t v_2 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
      _fx_N10Ast__pat_t p_0 = 0;
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_3 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
      _fx_N10Ast__exp_t e_0 = 0;
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
      _fx_T2N10Ast__pat_tN10Ast__exp_t v_4 = {0};
      _fx_LT2N10Ast__pat_tN10Ast__exp_t v_5 = 0;
      FX_CALL(
         _fx_M6ParserFM9parse_patT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t2LT2N14Lexer__token_tR10Ast__loc_tB(ts_2,
            false, &v_2, 0), _fx_catch_10);
      FX_COPY_PTR(v_2.t0, &ts_3);
      FX_COPY_PTR(v_2.t1, &p_0);
      if (ts_3 != 0) {
         if (ts_3->hd.t0.tag == 60) {
            FX_COPY_PTR(ts_3->tl, &ts_4); goto _fx_endmatch_0;
         }
      }
      fx_exn_t v_6 = {0};
      _fx_R10Ast__loc_t loc_1;
      if (ts_3 != 0) {
         loc_1 = ts_3->hd.t1;
      }
      else {
         loc_1 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_2);
      fx_str_t slit_1 = FX_MAKE_STR("\'=>\' is expected");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_6), _fx_catch_2);
      FX_THROW(&v_6, true, _fx_catch_2);

   _fx_catch_2: ;
      fx_free_exn(&v_6);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_10);
      if (ts_4 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_7 = ts_4->tl;
         if (v_7 != 0) {
            if (v_7->hd.t0.tag == 50) {
               _fx_T2N14Lexer__token_tR10Ast__loc_t* v_8 = &ts_4->hd;
               if (v_8->t0.tag == 49) {
                  _fx_N10Ast__exp_t v_9 = 0;
                  FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&v_8->t1, &v_9), _fx_catch_3);
                  _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(v_7->tl, v_9, &v_3);

               _fx_catch_3: ;
                  if (v_9) {
                     _fx_free_N10Ast__exp_t(&v_9);
                  }
                  goto _fx_endmatch_2;
               }
            }
         }
      }
      if (ts_4 != 0) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t v_10 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_7 = 0;
         _fx_LN10Ast__exp_t el_0 = 0;
         FX_CALL(
            _fx_M6ParserFM12parse_expseqT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
               ts_4, false, &v_10, 0), _fx_catch_9);
         FX_COPY_PTR(v_10.t0, &ts_7);
         FX_COPY_PTR(v_10.t1, &el_0);
         if (el_0 != 0) {
            _fx_N10Ast__exp_t v_11 = 0;
            if (el_0 == 0) {
               FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&_fx_g10Ast__noloc, &v_11), _fx_catch_4);

            _fx_catch_4: ;
               goto _fx_endmatch_1;
            }
            if (el_0 != 0) {
               if (el_0->tl == 0) {
                  FX_COPY_PTR(el_0->hd, &v_11); goto _fx_endmatch_1;
               }
            }
            _fx_LR10Ast__loc_t llist_0 = 0;
            _fx_N10Ast__typ_t v_12 = 0;
            _fx_T2N10Ast__typ_tR10Ast__loc_t v_13 = {0};
            _fx_LR10Ast__loc_t lstend_0 = 0;
            _fx_LN10Ast__exp_t lst_1 = el_0;
            for (; lst_1; lst_1 = lst_1->tl) {
               _fx_N10Ast__exp_t e_1 = lst_1->hd;
               _fx_R10Ast__loc_t res_0;
               FX_CALL(_fx_M3AstFM11get_exp_locRM5loc_t1N10Ast__exp_t(e_1, &res_0, 0), _fx_catch_5);
               _fx_LR10Ast__loc_t node_0 = 0;
               FX_CALL(_fx_cons_LR10Ast__loc_t(&res_0, 0, false, &node_0), _fx_catch_5);
               FX_LIST_APPEND(llist_0, lstend_0, node_0);

            _fx_catch_5: ;
               FX_CHECK_EXN(_fx_catch_6);
            }
            _fx_R10Ast__loc_t loc_2;
            FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(llist_0, &_fx_g10Ast__noloc, &loc_2, 0), _fx_catch_6);
            FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_12, 0), _fx_catch_6);
            _fx_make_T2N10Ast__typ_tR10Ast__loc_t(v_12, &loc_2, &v_13);
            FX_CALL(_fx_M3AstFM6ExpSeqN10Ast__exp_t2LN10Ast__exp_tT2N10Ast__typ_tRM5loc_t(el_0, &v_13, &v_11), _fx_catch_6);

         _fx_catch_6: ;
            _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&v_13);
            if (v_12) {
               _fx_free_N10Ast__typ_t(&v_12);
            }
            FX_FREE_LIST_SIMPLE(&llist_0);

         _fx_endmatch_1: ;
            FX_CHECK_EXN(_fx_catch_7);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_7, v_11, &v_3);

         _fx_catch_7: ;
            if (v_11) {
               _fx_free_N10Ast__exp_t(&v_11);
            }
         }
         else {
            fx_exn_t v_14 = {0};
            _fx_R10Ast__loc_t loc_3;
            if (ts_7 != 0) {
               loc_3 = ts_7->hd.t1;
            }
            else {
               loc_3 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_8);
            fx_str_t slit_2 =
               FX_MAKE_STR("some expressions are expected; use \'{}\' if there is no action for the particular match case");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_2, &v_14), _fx_catch_8);
            FX_THROW(&v_14, true, _fx_catch_8);

         _fx_catch_8: ;
            fx_free_exn(&v_14);
         }
         FX_CHECK_EXN(_fx_catch_9);

      _fx_catch_9: ;
         if (el_0) {
            _fx_free_LN10Ast__exp_t(&el_0);
         }
         if (ts_7) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_7);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&v_10);
         goto _fx_endmatch_2;
      }
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_10);

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_10);
      FX_COPY_PTR(v_3.t0, &ts_5);
      FX_COPY_PTR(v_3.t1, &e_0);
      if (ts_5 != 0) {
         if (ts_5->hd.t0.tag == 55) {
            FX_COPY_PTR(ts_5->tl, &ts_6); goto _fx_endmatch_3;
         }
      }
      FX_COPY_PTR(ts_5, &ts_6);

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_10);
      _fx_make_T2N10Ast__pat_tN10Ast__exp_t(p_0, e_0, &v_4);
      FX_CALL(_fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(&v_4, result_3, true, &v_5), _fx_catch_10);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
      FX_COPY_PTR(ts_6, &ts_1);
      _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&result_2);
      FX_COPY_PTR(v_5, &result_2);

   _fx_catch_10: ;
      if (v_5) {
         _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&v_5);
      }
      _fx_free_T2N10Ast__pat_tN10Ast__exp_t(&v_4);
      if (ts_6) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
      }
      if (e_0) {
         _fx_free_N10Ast__exp_t(&e_0);
      }
      if (ts_5) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_3);
      if (ts_4) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
      }
      if (p_0) {
         _fx_free_N10Ast__pat_t(&p_0);
      }
      if (ts_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__pat_t(&v_2);

   _fx_endmatch_4: ;
      FX_CHECK_EXN(_fx_catch_11);

   _fx_catch_11: ;
      if (result_3) {
         _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM17parse_match_casesT2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 49) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_0 = ts_0->tl;
         if (v_0 != 0) {
            if (v_0->hd.t0.tag == 55) {
               FX_COPY_PTR(v_0->tl, &ts_1); goto _fx_endmatch_0;
            }
         }
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 49) {
         FX_COPY_PTR(ts_0->tl, &ts_1); goto _fx_endmatch_0;
      }
   }
   fx_exn_t v_1 = {0};
   _fx_R10Ast__loc_t loc_0;
   if (ts_0 != 0) {
      loc_0 = ts_0->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_0);
   fx_str_t slit_0 = FX_MAKE_STR("\'{\', followed by optional \'|\', is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_1), _fx_catch_0);
   FX_THROW(&v_1, true, _fx_catch_0);

_fx_catch_0: ;
   fx_free_exn(&v_1);

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM19extend_match_cases_T2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tLT2N10Ast__pat_tN10Ast__exp_t(
         ts_1, 0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM17parse_atomic_typ_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 2) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS v_0 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
         fx_str_t i_0 = {0};
         _fx_N10Ast__typ_t t_0 = 0;
         fx_str_t slit_0 = FX_MAKE_STR("");
         FX_CALL(
            _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(ts_0, false,
               &slit_0, &v_0, 0), _fx_catch_12);
         FX_COPY_PTR(v_0.t0, &ts_1);
         fx_copy_str(&v_0.t1, &i_0);
         fx_str_t slit_1 = FX_MAKE_STR("int");
         if (fx_streq(&i_0, &slit_1)) {
            FX_COPY_PTR(_fx_g14Parser__TypInt, &t_0); goto _fx_endmatch_0;
         }
         fx_str_t slit_2 = FX_MAKE_STR("long");
         if (fx_streq(&i_0, &slit_2)) {
            FX_COPY_PTR(_fx_g15Parser__TypLong, &t_0); goto _fx_endmatch_0;
         }
         fx_str_t slit_3 = FX_MAKE_STR("float");
         if (fx_streq(&i_0, &slit_3)) {
            FX_CALL(_fx_M3AstFM8TypFloatN10Ast__typ_t1i(32, &t_0), _fx_catch_0);  _fx_catch_0: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_4 = FX_MAKE_STR("double");
         if (fx_streq(&i_0, &slit_4)) {
            FX_CALL(_fx_M3AstFM8TypFloatN10Ast__typ_t1i(64, &t_0), _fx_catch_1);  _fx_catch_1: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_5 = FX_MAKE_STR("string");
         if (fx_streq(&i_0, &slit_5)) {
            FX_COPY_PTR(_fx_g17Parser__TypString, &t_0); goto _fx_endmatch_0;
         }
         fx_str_t slit_6 = FX_MAKE_STR("char");
         if (fx_streq(&i_0, &slit_6)) {
            FX_COPY_PTR(_fx_g15Parser__TypChar, &t_0); goto _fx_endmatch_0;
         }
         fx_str_t slit_7 = FX_MAKE_STR("bool");
         if (fx_streq(&i_0, &slit_7)) {
            FX_COPY_PTR(_fx_g15Parser__TypBool, &t_0); goto _fx_endmatch_0;
         }
         fx_str_t slit_8 = FX_MAKE_STR("int8");
         if (fx_streq(&i_0, &slit_8)) {
            FX_CALL(_fx_M3AstFM7TypSIntN10Ast__typ_t1i(8, &t_0), _fx_catch_2);  _fx_catch_2: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_9 = FX_MAKE_STR("uint8");
         if (fx_streq(&i_0, &slit_9)) {
            FX_CALL(_fx_M3AstFM7TypUIntN10Ast__typ_t1i(8, &t_0), _fx_catch_3);  _fx_catch_3: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_10 = FX_MAKE_STR("int16");
         if (fx_streq(&i_0, &slit_10)) {
            FX_CALL(_fx_M3AstFM7TypSIntN10Ast__typ_t1i(16, &t_0), _fx_catch_4);  _fx_catch_4: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_11 = FX_MAKE_STR("uint16");
         if (fx_streq(&i_0, &slit_11)) {
            FX_CALL(_fx_M3AstFM7TypUIntN10Ast__typ_t1i(16, &t_0), _fx_catch_5);  _fx_catch_5: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_12 = FX_MAKE_STR("int32");
         if (fx_streq(&i_0, &slit_12)) {
            FX_CALL(_fx_M3AstFM7TypSIntN10Ast__typ_t1i(32, &t_0), _fx_catch_6);  _fx_catch_6: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_13 = FX_MAKE_STR("uint32");
         if (fx_streq(&i_0, &slit_13)) {
            FX_CALL(_fx_M3AstFM7TypUIntN10Ast__typ_t1i(32, &t_0), _fx_catch_7);  _fx_catch_7: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_14 = FX_MAKE_STR("int64");
         if (fx_streq(&i_0, &slit_14)) {
            FX_CALL(_fx_M3AstFM7TypSIntN10Ast__typ_t1i(64, &t_0), _fx_catch_8);  _fx_catch_8: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_15 = FX_MAKE_STR("uint64");
         if (fx_streq(&i_0, &slit_15)) {
            FX_CALL(_fx_M3AstFM7TypUIntN10Ast__typ_t1i(64, &t_0), _fx_catch_9);  _fx_catch_9: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_16 = FX_MAKE_STR("half");
         if (fx_streq(&i_0, &slit_16)) {
            FX_CALL(_fx_M3AstFM8TypFloatN10Ast__typ_t1i(16, &t_0), _fx_catch_10);  _fx_catch_10: ; goto _fx_endmatch_0;
         }
         fx_str_t slit_17 = FX_MAKE_STR("void");
         if (fx_streq(&i_0, &slit_17)) {
            FX_COPY_PTR(_fx_g15Parser__TypVoid, &t_0); goto _fx_endmatch_0;
         }
         fx_str_t slit_18 = FX_MAKE_STR("exn");
         if (fx_streq(&i_0, &slit_18)) {
            FX_COPY_PTR(_fx_g14Parser__TypExn, &t_0); goto _fx_endmatch_0;
         }
         fx_str_t slit_19 = FX_MAKE_STR("cptr");
         if (fx_streq(&i_0, &slit_19)) {
            FX_COPY_PTR(_fx_g19Parser__TypCPointer, &t_0); goto _fx_endmatch_0;
         }
         _fx_R9Ast__id_t v_1;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&i_0, &v_1, 0), _fx_catch_11);
         FX_CALL(_fx_M3AstFM6TypAppN10Ast__typ_t2LN10Ast__typ_tRM4id_t(0, &v_1, &t_0), _fx_catch_11);

      _fx_catch_11: ;

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_12);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(ts_1, t_0, fx_result);

      _fx_catch_12: ;
         if (t_0) {
            _fx_free_N10Ast__typ_t(&t_0);
         }
         FX_FREE_STR(&i_0);
         if (ts_1) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&v_0);
         goto _fx_endmatch_1;
      }
   }
   if (ts_0 != 0) {
      _fx_N14Lexer__token_t* v_2 = &ts_0->hd.t0;
      if (v_2->tag == 3) {
         _fx_N10Ast__typ_t v_3 = 0;
         _fx_R9Ast__id_t v_4;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_2->u.TYVAR, &v_4, 0), _fx_catch_13);
         FX_CALL(_fx_M3AstFM6TypAppN10Ast__typ_t2LN10Ast__typ_tRM4id_t(0, &v_4, &v_3), _fx_catch_13);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(ts_0->tl, v_3, fx_result);

      _fx_catch_13: ;
         if (v_3) {
            _fx_free_N10Ast__typ_t(&v_3);
         }
         goto _fx_endmatch_1;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_5 = &ts_0->hd;
      if (v_5->t0.tag == 44) {
         FX_CALL(
            _fx_M6ParserFM15parse_typtuple_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__typ_tR10Ast__loc_t(
               ts_0->tl, false, 0, &v_5->t1, fx_result, 0), _fx_catch_14);

      _fx_catch_14: ;
         goto _fx_endmatch_1;
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 49) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_6 = ts_0->tl;
         if (v_6 != 0) {
            if (v_6->hd.t0.tag == 14) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_7 = v_6->tl;
               if (v_7 != 0) {
                  if (v_7->hd.t0.tag == 50) {
                     _fx_Nt6option1N10Ast__typ_t v_8 = 0;
                     _fx_rNt6option1N10Ast__typ_t v_9 = 0;
                     _fx_N10Ast__typ_t v_10 = 0;
                     FX_CALL(_fx_M6ParserFM4SomeNt6option1N10Ast__typ_t1N10Ast__typ_t(_fx_g20Parser__TypVarRecord, &v_8),
                        _fx_catch_15);
                     FX_CALL(_fx_make_rNt6option1N10Ast__typ_t(v_8, &v_9), _fx_catch_15);
                     FX_CALL(_fx_M3AstFM6TypVarN10Ast__typ_t1rNt6option1N10Ast__typ_t(v_9, &v_10), _fx_catch_15);
                     _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(v_7->tl, v_10, fx_result);

                  _fx_catch_15: ;
                     if (v_10) {
                        _fx_free_N10Ast__typ_t(&v_10);
                     }
                     if (v_9) {
                        _fx_free_rNt6option1N10Ast__typ_t(&v_9);
                     }
                     if (v_8) {
                        _fx_free_Nt6option1N10Ast__typ_t(&v_8);
                     }
                     goto _fx_endmatch_1;
                  }
               }
            }
         }
      }
   }
   fx_exn_t v_11 = {0};
   _fx_R10Ast__loc_t loc_0;
   if (ts_0 != 0) {
      loc_0 = ts_0->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_16);
   fx_str_t slit_20 = FX_MAKE_STR("type is expected here (starting from indent, type var, \'(\' or \'{\'");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_20, &v_11), _fx_catch_16);
   FX_THROW(&v_11, true, _fx_catch_16);

_fx_catch_16: ;
   fx_free_exn(&v_11);

_fx_endmatch_1: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM19extend_typespec_nf_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_N10Ast__typ_t_data_t* result_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__typ_t result_2 = 0;
   int fx_status = 0;
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_N10Ast__typ_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(result_2, &result_3);
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_0 = &ts_2->hd.t0;
         if (v_0->tag == 2) {
            if (v_0->u.IDENT.t0 == false) {
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS v_1 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
               fx_str_t i_0 = {0};
               _fx_N10Ast__typ_t t_0 = 0;
               fx_str_t slit_0 = FX_MAKE_STR("");
               FX_CALL(
                  _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(ts_2,
                     false, &slit_0, &v_1, 0), _fx_catch_4);
               FX_COPY_PTR(v_1.t0, &ts_3);
               fx_copy_str(&v_1.t1, &i_0);
               fx_str_t slit_1 = FX_MAKE_STR("list");
               if (fx_streq(&i_0, &slit_1)) {
                  FX_CALL(_fx_M3AstFM7TypListN10Ast__typ_t1N10Ast__typ_t(result_3, &t_0), _fx_catch_0);

               _fx_catch_0: ;
                  goto _fx_endmatch_0;
               }
               fx_str_t slit_2 = FX_MAKE_STR("vector");
               if (fx_streq(&i_0, &slit_2)) {
                  FX_CALL(_fx_M3AstFM9TypVectorN10Ast__typ_t1N10Ast__typ_t(result_3, &t_0), _fx_catch_1);

               _fx_catch_1: ;
                  goto _fx_endmatch_0;
               }
               _fx_LN10Ast__typ_t v_2 = 0;
               int tag_0 = FX_REC_VARIANT_TAG(result_3);
               if (tag_0 == 17) {
                  FX_COPY_PTR(result_3->u.TypTuple, &v_2);
               }
               else if (tag_0 != 13) {
                  FX_CALL(_fx_cons_LN10Ast__typ_t(result_3, 0, true, &v_2), _fx_catch_2);  _fx_catch_2: ;
               }
               FX_CHECK_EXN(_fx_catch_3);
               _fx_R9Ast__id_t v_3;
               FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&i_0, &v_3, 0), _fx_catch_3);
               FX_CALL(_fx_M3AstFM6TypAppN10Ast__typ_t2LN10Ast__typ_tRM4id_t(v_2, &v_3, &t_0), _fx_catch_3);

            _fx_catch_3: ;
               if (v_2) {
                  _fx_free_LN10Ast__typ_t(&v_2);
               }

            _fx_endmatch_0: ;
               FX_CHECK_EXN(_fx_catch_4);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(ts_3, &ts_1);
               _fx_free_N10Ast__typ_t(&result_2);
               FX_COPY_PTR(t_0, &result_2);

            _fx_catch_4: ;
               if (t_0) {
                  _fx_free_N10Ast__typ_t(&t_0);
               }
               FX_FREE_STR(&i_0);
               if (ts_3) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&v_1);
               goto _fx_endmatch_2;
            }
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 62) {
            _fx_LN10Ast__typ_t v_4 = 0;
            _fx_N10Ast__typ_t v_5 = 0;
            FX_CALL(_fx_cons_LN10Ast__typ_t(result_3, 0, true, &v_4), _fx_catch_5);
            _fx_R9Ast__id_t v_6;
            fx_str_t slit_3 = FX_MAKE_STR("option");
            FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&slit_3, &v_6, 0), _fx_catch_5);
            FX_CALL(_fx_M3AstFM6TypAppN10Ast__typ_t2LN10Ast__typ_tRM4id_t(v_4, &v_6, &v_5), _fx_catch_5);
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(*rest_0, &ts_1);
            _fx_free_N10Ast__typ_t(&result_2);
            FX_COPY_PTR(v_5, &result_2);

         _fx_catch_5: ;
            if (v_5) {
               _fx_free_N10Ast__typ_t(&v_5);
            }
            if (v_4) {
               _fx_free_LN10Ast__typ_t(&v_4);
            }
            goto _fx_endmatch_2;
         }
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_7 = &ts_2->hd.t0;
         if (v_7->tag == 33) {
            if (v_7->u.REF == false) {
               _fx_N10Ast__typ_t v_8 = 0;
               FX_CALL(_fx_M3AstFM6TypRefN10Ast__typ_t1N10Ast__typ_t(result_3, &v_8), _fx_catch_6);
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_1, &ts_1);
               _fx_free_N10Ast__typ_t(&result_2);
               FX_COPY_PTR(v_8, &result_2);

            _fx_catch_6: ;
               if (v_8) {
                  _fx_free_N10Ast__typ_t(&v_8);
               }
               goto _fx_endmatch_2;
            }
         }
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_9 = &ts_2->hd.t0;
         if (v_9->tag == 47) {
            if (v_9->u.LSQUARE == false) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_10 = ts_2->tl;
               if (v_10 != 0) {
                  if (v_10->hd.t0.tag == 65) {
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t v_11 = v_10->tl;
                     if (v_11 != 0) {
                        if (v_11->hd.t0.tag == 48) {
                           _fx_N10Ast__typ_t v_12 = 0;
                           _fx_Nt6option1N10Ast__typ_t v_13 = 0;
                           _fx_rNt6option1N10Ast__typ_t v_14 = 0;
                           _fx_N10Ast__typ_t v_15 = 0;
                           FX_CALL(_fx_M3AstFM11TypVarArrayN10Ast__typ_t1N10Ast__typ_t(result_3, &v_12), _fx_catch_7);
                           FX_CALL(_fx_M6ParserFM4SomeNt6option1N10Ast__typ_t1N10Ast__typ_t(v_12, &v_13), _fx_catch_7);
                           FX_CALL(_fx_make_rNt6option1N10Ast__typ_t(v_13, &v_14), _fx_catch_7);
                           FX_CALL(_fx_M3AstFM6TypVarN10Ast__typ_t1rNt6option1N10Ast__typ_t(v_14, &v_15), _fx_catch_7);
                           _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_2 = &v_11->tl;
                           _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                           FX_COPY_PTR(*rest_2, &ts_1);
                           _fx_free_N10Ast__typ_t(&result_2);
                           FX_COPY_PTR(v_15, &result_2);

                        _fx_catch_7: ;
                           if (v_15) {
                              _fx_free_N10Ast__typ_t(&v_15);
                           }
                           if (v_14) {
                              _fx_free_rNt6option1N10Ast__typ_t(&v_14);
                           }
                           if (v_13) {
                              _fx_free_Nt6option1N10Ast__typ_t(&v_13);
                           }
                           if (v_12) {
                              _fx_free_N10Ast__typ_t(&v_12);
                           }
                           goto _fx_endmatch_2;
                        }
                     }
                  }
               }
            }
         }
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_16 = &ts_2->hd.t0;
         if (v_16->tag == 47) {
            if (v_16->u.LSQUARE == false) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t vts_0 = 0;
               _fx_N10Ast__typ_t v_17 = 0;
               FX_COPY_PTR(ts_2->tl, &vts_0);
               int_ ndims_0 = 1;
               for (;;) {
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t vts_1 = 0;
                  FX_COPY_PTR(vts_0, &vts_1);
                  if (vts_1 != 0) {
                     if (vts_1->hd.t0.tag == 51) {
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_3 = &vts_1->tl;
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
                        FX_COPY_PTR(*rest_3, &vts_0);
                        ndims_0 = ndims_0 + 1;
                        goto _fx_endmatch_1;
                     }
                  }
                  if (vts_1 != 0) {
                     if (vts_1->hd.t0.tag == 48) {
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_4 = &vts_1->tl;
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
                        FX_COPY_PTR(*rest_4, &vts_0);
                        FX_BREAK(_fx_catch_8);

                     _fx_catch_8: ;
                        goto _fx_endmatch_1;
                     }
                  }
                  fx_exn_t v_18 = {0};
                  _fx_R10Ast__loc_t loc_0;
                  if (ts_2 != 0) {
                     loc_0 = ts_2->hd.t1;
                  }
                  else {
                     loc_0 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_9);
                  fx_str_t slit_4 = FX_MAKE_STR("unfinished array shape specification (missing \']\'?)");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_4, &v_18), _fx_catch_9);
                  FX_THROW(&v_18, true, _fx_catch_9);

               _fx_catch_9: ;
                  fx_free_exn(&v_18);

               _fx_endmatch_1: ;
                  FX_CHECK_EXN(_fx_catch_10);

               _fx_catch_10: ;
                  if (vts_1) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_1);
                  }
                  FX_CHECK_BREAK();
                  FX_CHECK_EXN(_fx_catch_11);
               }
               FX_CALL(_fx_M3AstFM8TypArrayN10Ast__typ_t2iN10Ast__typ_t(ndims_0, result_3, &v_17), _fx_catch_11);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(vts_0, &ts_1);
               _fx_free_N10Ast__typ_t(&result_2);
               FX_COPY_PTR(v_17, &result_2);

            _fx_catch_11: ;
               if (v_17) {
                  _fx_free_N10Ast__typ_t(&v_17);
               }
               if (vts_0) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&vts_0);
               }
               goto _fx_endmatch_2;
            }
         }
      }
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t result_4 = {0};
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(ts_2, result_3, &result_4);
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_1);
      _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_4, &result_1);
      FX_BREAK(_fx_catch_12);

   _fx_catch_12: ;
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_4);

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_13);

   _fx_catch_13: ;
      if (result_3) {
         _fx_free_N10Ast__typ_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_N10Ast__typ_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM17parse_typespec_nfT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__typ_t t_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM17parse_atomic_typ_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
         &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &t_0);
   FX_CALL(
      _fx_M6ParserFM19extend_typespec_nf_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
         ts_1, t_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (t_0) {
      _fx_free_N10Ast__typ_t(&t_0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM15parse_typtuple_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t4LT2N14Lexer__token_tR10Ast__loc_tBLN10Ast__typ_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LN10Ast__typ_t_data_t* result_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LN10Ast__typ_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(result_0, &result_2);
   _fx_R10Ast__loc_t loc_1 = *loc_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LN10Ast__typ_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(result_2, &result_3);
      _fx_R10Ast__loc_t loc_2 = loc_1;
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 14) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_0 = ts_2->tl;
            if (v_0 != 0) {
               if (v_0->hd.t0.tag == 46) {
                  _fx_N10Ast__typ_t t_0 = 0;
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t result_4 = {0};
                  if (result_3 == 0) {
                     _fx_N10Ast__typ_t v_1 = 0;
                     _fx_Nt6option1N10Ast__typ_t v_2 = 0;
                     _fx_rNt6option1N10Ast__typ_t v_3 = 0;
                     FX_CALL(_fx_M3AstFM11TypVarTupleN10Ast__typ_t1Nt6option1N10Ast__typ_t(_fx_g14Parser__None3_, &v_1),
                        _fx_catch_0);
                     FX_CALL(_fx_M6ParserFM4SomeNt6option1N10Ast__typ_t1N10Ast__typ_t(v_1, &v_2), _fx_catch_0);
                     FX_CALL(_fx_make_rNt6option1N10Ast__typ_t(v_2, &v_3), _fx_catch_0);
                     FX_CALL(_fx_M3AstFM6TypVarN10Ast__typ_t1rNt6option1N10Ast__typ_t(v_3, &t_0), _fx_catch_0);

                  _fx_catch_0: ;
                     if (v_3) {
                        _fx_free_rNt6option1N10Ast__typ_t(&v_3);
                     }
                     if (v_2) {
                        _fx_free_Nt6option1N10Ast__typ_t(&v_2);
                     }
                     if (v_1) {
                        _fx_free_N10Ast__typ_t(&v_1);
                     }
                     goto _fx_endmatch_0;
                  }
                  if (result_3 != 0) {
                     if (result_3->tl == 0) {
                        fx_exn_t v_4 = {0};
                        _fx_Nt6option1N10Ast__typ_t v_5 = 0;
                        _fx_N10Ast__typ_t v_6 = 0;
                        _fx_Nt6option1N10Ast__typ_t v_7 = 0;
                        _fx_rNt6option1N10Ast__typ_t v_8 = 0;
                        if (!expect_comma_2) {
                           _fx_R10Ast__loc_t loc_3;
                           if (ts_2 != 0) {
                              loc_3 = ts_2->hd.t1;
                           }
                           else {
                              loc_3 = _fx_g18Parser__parser_ctx.default_loc;
                           }
                           FX_CHECK_EXN(_fx_catch_1);
                           fx_str_t slit_0 = FX_MAKE_STR("extra \',\' before \'...\'?");
                           FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_0, &v_4), _fx_catch_1);
                           FX_THROW(&v_4, true, _fx_catch_1);
                        }
                        FX_CALL(_fx_M6ParserFM4SomeNt6option1N10Ast__typ_t1N10Ast__typ_t(result_3->hd, &v_5), _fx_catch_1);
                        FX_CALL(_fx_M3AstFM11TypVarTupleN10Ast__typ_t1Nt6option1N10Ast__typ_t(v_5, &v_6), _fx_catch_1);
                        FX_CALL(_fx_M6ParserFM4SomeNt6option1N10Ast__typ_t1N10Ast__typ_t(v_6, &v_7), _fx_catch_1);
                        FX_CALL(_fx_make_rNt6option1N10Ast__typ_t(v_7, &v_8), _fx_catch_1);
                        FX_CALL(_fx_M3AstFM6TypVarN10Ast__typ_t1rNt6option1N10Ast__typ_t(v_8, &t_0), _fx_catch_1);

                     _fx_catch_1: ;
                        if (v_8) {
                           _fx_free_rNt6option1N10Ast__typ_t(&v_8);
                        }
                        if (v_7) {
                           _fx_free_Nt6option1N10Ast__typ_t(&v_7);
                        }
                        if (v_6) {
                           _fx_free_N10Ast__typ_t(&v_6);
                        }
                        if (v_5) {
                           _fx_free_Nt6option1N10Ast__typ_t(&v_5);
                        }
                        fx_free_exn(&v_4);
                        goto _fx_endmatch_0;
                     }
                  }
                  fx_exn_t v_9 = {0};
                  _fx_R10Ast__loc_t loc_4;
                  if (ts_2 != 0) {
                     loc_4 = ts_2->hd.t1;
                  }
                  else {
                     loc_4 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_2);
                  fx_str_t slit_1 =
                     FX_MAKE_STR("\'...\' can only be used with \'{...}\', \'(...)\' or \'(t1 ...)\' type specifications");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_4, &slit_1, &v_9), _fx_catch_2);
                  FX_THROW(&v_9, true, _fx_catch_2);

               _fx_catch_2: ;
                  fx_free_exn(&v_9);

               _fx_endmatch_0: ;
                  FX_CHECK_EXN(_fx_catch_3);
                  _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(v_0->tl, t_0, &result_4);
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_1);
                  _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_4, &result_1);
                  FX_BREAK(_fx_catch_3);

               _fx_catch_3: ;
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_4);
                  if (t_0) {
                     _fx_free_N10Ast__typ_t(&t_0);
                  }
                  goto _fx_endmatch_3;
               }
            }
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_10 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               _fx_free_LN10Ast__typ_t(&result_2);
               FX_COPY_PTR(result_3, &result_2);
               loc_1 = loc_2;
            }
            else {
               _fx_R10Ast__loc_t loc_5;
               if (ts_2 != 0) {
                  loc_5 = ts_2->hd.t1;
               }
               else {
                  loc_5 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_4);
               fx_str_t slit_2 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_5, &slit_2, &v_10), _fx_catch_4);
               FX_THROW(&v_10, true, _fx_catch_4);
            }

         _fx_catch_4: ;
            fx_free_exn(&v_10);
            goto _fx_endmatch_3;
         }
      }
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_11 = ts_2->tl;
         if (v_11 != 0) {
            if (v_11->hd.t0.tag == 66) {
               _fx_N14Lexer__token_t* v_12 = &ts_2->hd.t0;
               if (v_12->tag == 1) {
                  _fx_N10Ast__lit_t* v_13 = &v_12->u.LITERAL;
                  if (v_13->tag == 1) {
                     fx_exn_t v_14 = {0};
                     fx_exn_t v_15 = {0};
                     _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_16 = {0};
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
                     _fx_N10Ast__typ_t t_1 = 0;
                     _fx_LN10Ast__typ_t tt_0 = 0;
                     _fx_LN10Ast__typ_t v_17 = 0;
                     int64_t n_0 = v_13->u.LitInt;
                     if (expect_comma_2) {
                        _fx_R10Ast__loc_t loc_6;
                        if (ts_2 != 0) {
                           loc_6 = ts_2->hd.t1;
                        }
                        else {
                           loc_6 = _fx_g18Parser__parser_ctx.default_loc;
                        }
                        FX_CHECK_EXN(_fx_catch_8);
                        fx_str_t slit_3 = FX_MAKE_STR("\',\' is expected");
                        FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_6, &slit_3, &v_14), _fx_catch_8);
                        FX_THROW(&v_14, true, _fx_catch_8);
                     }
                     if (n_0 <= 0LL) {
                        _fx_R10Ast__loc_t loc_7;
                        if (ts_2 != 0) {
                           loc_7 = ts_2->hd.t1;
                        }
                        else {
                           loc_7 = _fx_g18Parser__parser_ctx.default_loc;
                        }
                        FX_CHECK_EXN(_fx_catch_8);
                        fx_str_t slit_4 = FX_MAKE_STR("tuple multiplicator should be positive");
                        FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_7, &slit_4, &v_15), _fx_catch_8);
                        FX_THROW(&v_15, true, _fx_catch_8);
                     }
                     FX_CALL(
                        _fx_M6ParserFM17parse_typespec_nfT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
                           v_11->tl, &v_16, 0), _fx_catch_8);
                     FX_COPY_PTR(v_16.t0, &ts_3);
                     FX_COPY_PTR(v_16.t1, &t_1);
                     _fx_LN10Ast__typ_t lstend_0 = 0;
                     int_ v_18 = (int_)n_0;
                     for (int_ i_0 = 0; i_0 < v_18; i_0++) {
                        _fx_LN10Ast__typ_t node_0 = 0;
                        FX_CALL(_fx_cons_LN10Ast__typ_t(t_1, 0, false, &node_0), _fx_catch_5);
                        FX_LIST_APPEND(tt_0, lstend_0, node_0);

                     _fx_catch_5: ;
                        FX_CHECK_EXN(_fx_catch_8);
                     }
                     if (tt_0 == 0) {
                        FX_COPY_PTR(result_3, &v_17);
                     }
                     else if (result_3 == 0) {
                        FX_COPY_PTR(tt_0, &v_17);
                     }
                     else {
                        _fx_LN10Ast__typ_t v_19 = 0;
                        _fx_LN10Ast__typ_t lstend_1 = 0;
                        _fx_LN10Ast__typ_t lst_0 = tt_0;
                        for (; lst_0; lst_0 = lst_0->tl) {
                           _fx_N10Ast__typ_t x_0 = lst_0->hd;
                           _fx_LN10Ast__typ_t node_1 = 0;
                           FX_CALL(_fx_cons_LN10Ast__typ_t(x_0, 0, false, &node_1), _fx_catch_6);
                           FX_LIST_APPEND(v_19, lstend_1, node_1);

                        _fx_catch_6: ;
                           FX_CHECK_EXN(_fx_catch_7);
                        }
                        _fx_M6ParserFM5link2LN10Ast__typ_t2LN10Ast__typ_tLN10Ast__typ_t(v_19, result_3, &v_17, 0);

                     _fx_catch_7: ;
                        if (v_19) {
                           _fx_free_LN10Ast__typ_t(&v_19);
                        }
                     }
                     FX_CHECK_EXN(_fx_catch_8);
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                     FX_COPY_PTR(ts_3, &ts_1);
                     expect_comma_1 = true;
                     _fx_free_LN10Ast__typ_t(&result_2);
                     FX_COPY_PTR(v_17, &result_2);
                     loc_1 = loc_2;

                  _fx_catch_8: ;
                     if (v_17) {
                        _fx_free_LN10Ast__typ_t(&v_17);
                     }
                     if (tt_0) {
                        _fx_free_LN10Ast__typ_t(&tt_0);
                     }
                     if (t_1) {
                        _fx_free_N10Ast__typ_t(&t_1);
                     }
                     if (ts_3) {
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
                     }
                     _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_16);
                     fx_free_exn(&v_15);
                     fx_free_exn(&v_14);
                     goto _fx_endmatch_3;
                  }
               }
            }
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 46) {
            _fx_N10Ast__typ_t t_2 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t result_5 = {0};
            if (result_3 != 0) {
               if (result_3->tl == 0) {
                  FX_COPY_PTR(result_3->hd, &t_2); goto _fx_endmatch_1;
               }
            }
            if (result_3 == 0) {
               fx_exn_t v_20 = {0};
               _fx_R10Ast__loc_t loc_8;
               if (ts_2 != 0) {
                  loc_8 = ts_2->hd.t1;
               }
               else {
                  loc_8 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_9);
               fx_str_t slit_5 = FX_MAKE_STR("empty tuple");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_8, &slit_5, &v_20), _fx_catch_9);
               FX_THROW(&v_20, true, _fx_catch_9);

            _fx_catch_9: ;
               fx_free_exn(&v_20);
               goto _fx_endmatch_1;
            }
            _fx_LN10Ast__typ_t __fold_result___0 = 0;
            _fx_LN10Ast__typ_t v_21 = 0;
            _fx_LN10Ast__typ_t lst_1 = result_3;
            for (; lst_1; lst_1 = lst_1->tl) {
               _fx_LN10Ast__typ_t r_0 = 0;
               _fx_N10Ast__typ_t a_0 = lst_1->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LN10Ast__typ_t(a_0, r_0, false, &r_0), _fx_catch_10);
               _fx_free_LN10Ast__typ_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_10: ;
               if (r_0) {
                  _fx_free_LN10Ast__typ_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_11);
            }
            FX_COPY_PTR(__fold_result___0, &v_21);
            FX_CALL(_fx_M3AstFM8TypTupleN10Ast__typ_t1LN10Ast__typ_t(v_21, &t_2), _fx_catch_11);

         _fx_catch_11: ;
            if (v_21) {
               _fx_free_LN10Ast__typ_t(&v_21);
            }
            if (__fold_result___0) {
               _fx_free_LN10Ast__typ_t(&__fold_result___0);
            }

         _fx_endmatch_1: ;
            FX_CHECK_EXN(_fx_catch_12);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(ts_2->tl, t_2, &result_5);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_5, &result_1);
            FX_BREAK(_fx_catch_12);

         _fx_catch_12: ;
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_5);
            if (t_2) {
               _fx_free_N10Ast__typ_t(&t_2);
            }
            goto _fx_endmatch_3;
         }
      }
      fx_exn_t v_22 = {0};
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_23 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
      _fx_N10Ast__typ_t t_3 = 0;
      if (expect_comma_2) {
         _fx_R10Ast__loc_t loc_9;
         if (ts_2 != 0) {
            loc_9 = ts_2->hd.t1;
         }
         else {
            loc_9 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_20);
         fx_str_t slit_6 = FX_MAKE_STR("\',\' is expected");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_9, &slit_6, &v_22), _fx_catch_20);
         FX_THROW(&v_22, true, _fx_catch_20);
      }
      FX_CALL(
         _fx_M6ParserFM17parse_typespec_nfT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
            ts_2, &v_23, 0), _fx_catch_20);
      FX_COPY_PTR(v_23.t0, &ts_4);
      FX_COPY_PTR(v_23.t1, &t_3);
      if (ts_4 != 0) {
         if (ts_4->hd.t0.tag == 66) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_24 = ts_4->tl;
            if (v_24 != 0) {
               _fx_N14Lexer__token_t* v_25 = &v_24->hd.t0;
               if (v_25->tag == 1) {
                  _fx_N10Ast__lit_t* v_26 = &v_25->u.LITERAL;
                  if (v_26->tag == 1) {
                     _fx_LN10Ast__typ_t tt_1 = 0;
                     _fx_LN10Ast__typ_t v_27 = 0;
                     _fx_LN10Ast__typ_t lstend_2 = 0;
                     int_ v_28 = (int_)v_26->u.LitInt;
                     for (int_ i_1 = 0; i_1 < v_28; i_1++) {
                        _fx_LN10Ast__typ_t node_2 = 0;
                        FX_CALL(_fx_cons_LN10Ast__typ_t(t_3, 0, false, &node_2), _fx_catch_13);
                        FX_LIST_APPEND(tt_1, lstend_2, node_2);

                     _fx_catch_13: ;
                        FX_CHECK_EXN(_fx_catch_16);
                     }
                     if (tt_1 == 0) {
                        FX_COPY_PTR(result_3, &v_27);
                     }
                     else if (result_3 == 0) {
                        FX_COPY_PTR(tt_1, &v_27);
                     }
                     else {
                        _fx_LN10Ast__typ_t v_29 = 0;
                        _fx_LN10Ast__typ_t lstend_3 = 0;
                        _fx_LN10Ast__typ_t lst_2 = tt_1;
                        for (; lst_2; lst_2 = lst_2->tl) {
                           _fx_N10Ast__typ_t x_1 = lst_2->hd;
                           _fx_LN10Ast__typ_t node_3 = 0;
                           FX_CALL(_fx_cons_LN10Ast__typ_t(x_1, 0, false, &node_3), _fx_catch_14);
                           FX_LIST_APPEND(v_29, lstend_3, node_3);

                        _fx_catch_14: ;
                           FX_CHECK_EXN(_fx_catch_15);
                        }
                        _fx_M6ParserFM5link2LN10Ast__typ_t2LN10Ast__typ_tLN10Ast__typ_t(v_29, result_3, &v_27, 0);

                     _fx_catch_15: ;
                        if (v_29) {
                           _fx_free_LN10Ast__typ_t(&v_29);
                        }
                     }
                     FX_CHECK_EXN(_fx_catch_16);
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &v_24->tl;
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                     FX_COPY_PTR(*rest_1, &ts_1);
                     expect_comma_1 = true;
                     _fx_free_LN10Ast__typ_t(&result_2);
                     FX_COPY_PTR(v_27, &result_2);
                     loc_1 = loc_2;

                  _fx_catch_16: ;
                     if (v_27) {
                        _fx_free_LN10Ast__typ_t(&v_27);
                     }
                     if (tt_1) {
                        _fx_free_LN10Ast__typ_t(&tt_1);
                     }
                     goto _fx_endmatch_2;
                  }
               }
            }
         }
      }
      if (ts_4 != 0) {
         if (ts_4->hd.t0.tag == 61) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_30 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
            _fx_N10Ast__typ_t rt_0 = 0;
            _fx_LN10Ast__typ_t v_31 = 0;
            _fx_N10Ast__typ_t v_32 = 0;
            _fx_LN10Ast__typ_t v_33 = 0;
            FX_CALL(
               _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
                  ts_4->tl, &v_30, 0), _fx_catch_18);
            FX_COPY_PTR(v_30.t0, &ts_5);
            FX_COPY_PTR(v_30.t1, &rt_0);
            int tag_0 = FX_REC_VARIANT_TAG(t_3);
            if (tag_0 == 17) {
               FX_COPY_PTR(t_3->u.TypTuple, &v_31);
            }
            else if (tag_0 != 13) {
               FX_CALL(_fx_cons_LN10Ast__typ_t(t_3, 0, true, &v_31), _fx_catch_17);  _fx_catch_17: ;
            }
            FX_CHECK_EXN(_fx_catch_18);
            FX_CALL(_fx_M3AstFM6TypFunN10Ast__typ_t2LN10Ast__typ_tN10Ast__typ_t(v_31, rt_0, &v_32), _fx_catch_18);
            FX_CALL(_fx_cons_LN10Ast__typ_t(v_32, result_3, true, &v_33), _fx_catch_18);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_5, &ts_1);
            expect_comma_1 = true;
            _fx_free_LN10Ast__typ_t(&result_2);
            FX_COPY_PTR(v_33, &result_2);
            loc_1 = loc_2;

         _fx_catch_18: ;
            if (v_33) {
               _fx_free_LN10Ast__typ_t(&v_33);
            }
            if (v_32) {
               _fx_free_N10Ast__typ_t(&v_32);
            }
            if (v_31) {
               _fx_free_LN10Ast__typ_t(&v_31);
            }
            if (rt_0) {
               _fx_free_N10Ast__typ_t(&rt_0);
            }
            if (ts_5) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_30);
            goto _fx_endmatch_2;
         }
      }
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_34 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
      _fx_N10Ast__typ_t t_4 = 0;
      _fx_LN10Ast__typ_t v_35 = 0;
      FX_CALL(
         _fx_M6ParserFM19extend_typespec_nf_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(
            ts_4, t_3, &v_34, 0), _fx_catch_19);
      FX_COPY_PTR(v_34.t0, &ts_6);
      FX_COPY_PTR(v_34.t1, &t_4);
      FX_CALL(_fx_cons_LN10Ast__typ_t(t_4, result_3, true, &v_35), _fx_catch_19);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
      FX_COPY_PTR(ts_6, &ts_1);
      expect_comma_1 = true;
      _fx_free_LN10Ast__typ_t(&result_2);
      FX_COPY_PTR(v_35, &result_2);
      loc_1 = loc_2;

   _fx_catch_19: ;
      if (v_35) {
         _fx_free_LN10Ast__typ_t(&v_35);
      }
      if (t_4) {
         _fx_free_N10Ast__typ_t(&t_4);
      }
      if (ts_6) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_34);

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_20);

   _fx_catch_20: ;
      if (t_3) {
         _fx_free_N10Ast__typ_t(&t_3);
      }
      if (ts_4) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_23);
      fx_free_exn(&v_22);

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_21);

   _fx_catch_21: ;
      if (result_3) {
         _fx_free_LN10Ast__typ_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LN10Ast__typ_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N10Ast__typ_t t_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM17parse_typespec_nfT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
         &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   FX_COPY_PTR(v_0.t1, &t_0);
   if (ts_1 != 0) {
      if (ts_1->hd.t0.tag == 61) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_1 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
         _fx_N10Ast__typ_t rt_0 = 0;
         _fx_LN10Ast__typ_t v_2 = 0;
         _fx_N10Ast__typ_t v_3 = 0;
         FX_CALL(
            _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_1->tl, &v_1, 0), _fx_catch_1);
         FX_COPY_PTR(v_1.t0, &ts_2);
         FX_COPY_PTR(v_1.t1, &rt_0);
         int tag_0 = FX_REC_VARIANT_TAG(t_0);
         if (tag_0 == 17) {
            FX_COPY_PTR(t_0->u.TypTuple, &v_2);
         }
         else if (tag_0 != 13) {
            FX_CALL(_fx_cons_LN10Ast__typ_t(t_0, 0, true, &v_2), _fx_catch_0);  _fx_catch_0: ;
         }
         FX_CHECK_EXN(_fx_catch_1);
         FX_CALL(_fx_M3AstFM6TypFunN10Ast__typ_t2LN10Ast__typ_tN10Ast__typ_t(v_2, rt_0, &v_3), _fx_catch_1);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(ts_2, v_3, fx_result);

      _fx_catch_1: ;
         if (v_3) {
            _fx_free_N10Ast__typ_t(&v_3);
         }
         if (v_2) {
            _fx_free_LN10Ast__typ_t(&v_2);
         }
         if (rt_0) {
            _fx_free_N10Ast__typ_t(&rt_0);
         }
         if (ts_2) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_1);
         goto _fx_endmatch_0;
      }
   }
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(ts_1, t_0, fx_result);

_fx_endmatch_0: ;

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (t_0) {
      _fx_free_N10Ast__typ_t(&t_0);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM13parse_relems_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tBLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_semicolon_0,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* result_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_semicolon_1 = expect_semicolon_0;
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_semicolon_2 = expect_semicolon_1;
      FX_COPY_PTR(result_2, &result_3);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 53) {
            fx_exn_t v_0 = {0};
            if (expect_semicolon_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_semicolon_1 = false;
               _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&result_2);
               FX_COPY_PTR(result_3, &result_2);
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \';\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_3;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 50) {
            fx_exn_t v_1 = {0};
            _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t __fold_result___0 = 0;
            _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t v_2 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t result_4 = {0};
            if (result_3 == 0) {
               _fx_R10Ast__loc_t loc_1;
               if (ts_2 != 0) {
                  loc_1 = ts_2->hd.t1;
               }
               else {
                  loc_1 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_2);
               fx_str_t slit_1 = FX_MAKE_STR("empty list of record elements");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_1), _fx_catch_2);
               FX_THROW(&v_1, true, _fx_catch_2);
            }
            _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_0 = result_3;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t r_0 = 0;
               _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* a_0 = &lst_0->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(a_0, r_0, false, &r_0),
                  _fx_catch_1);
               _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_1: ;
               if (r_0) {
                  _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_2);
            }
            FX_COPY_PTR(__fold_result___0, &v_2);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(ts_2->tl,
               v_2, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&result_4,
               &result_1);
            FX_BREAK(_fx_catch_2);

         _fx_catch_2: ;
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&result_4);
            if (v_2) {
               _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&v_2);
            }
            if (__fold_result___0) {
               _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&__fold_result___0);
            }
            fx_free_exn(&v_1);
            goto _fx_endmatch_3;
         }
      }
      bool res_0;
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_3 = ts_2->tl;
         if (v_3 != 0) {
            if (ts_2->hd.t0.tag == 2) {
               if (v_3->hd.t0.tag == 54) {
                  res_0 = true; goto _fx_endmatch_0;
               }
            }
         }
      }
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_4 = ts_2->tl;
         if (v_4 != 0) {
            if (ts_2->hd.t0.tag == 39) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_5 = v_4->tl;
               if (v_5 != 0) {
                  if (v_4->hd.t0.tag == 2) {
                     if (v_5->hd.t0.tag == 54) {
                        res_0 = true; goto _fx_endmatch_0;
                     }
                  }
               }
            }
         }
      }
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_6 = ts_2->tl;
         if (v_6 != 0) {
            if (ts_2->hd.t0.tag == 38) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_7 = v_6->tl;
               if (v_7 != 0) {
                  if (v_6->hd.t0.tag == 2) {
                     if (v_7->hd.t0.tag == 54) {
                        res_0 = true; goto _fx_endmatch_0;
                     }
                  }
               }
            }
         }
      }
      res_0 = false;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_11);
      if (res_0) {
         _fx_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t v_8 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         fx_str_t i_0 = {0};
         _fx_R16Ast__val_flags_t flags_0 = {0};
         fx_exn_t v_9 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_10 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_N10Ast__typ_t t_0 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_11 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
         _fx_N10Ast__exp_t default__0 = 0;
         _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t v_12 = {0};
         _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t v_13 = 0;
         if (ts_2 != 0) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_14 = ts_2->tl;
            if (v_14 != 0) {
               if (v_14->hd.t0.tag == 54) {
                  _fx_N14Lexer__token_t* v_15 = &ts_2->hd.t0;
                  if (v_15->tag == 2) {
                     _fx_R16Ast__val_flags_t v_16 = {0};
                     _fx_T2BS* vcase_0 = &v_15->u.IDENT;
                     FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_16, 0), _fx_catch_3);
                     _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t(v_14->tl, vcase_0->t0, &vcase_0->t1,
                        &v_16, &v_8);

                  _fx_catch_3: ;
                     _fx_free_R16Ast__val_flags_t(&v_16);
                     goto _fx_endmatch_1;
                  }
               }
            }
         }
         if (ts_2 != 0) {
            if (ts_2->hd.t0.tag == 39) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_17 = ts_2->tl;
               if (v_17 != 0) {
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t v_18 = v_17->tl;
                  if (v_18 != 0) {
                     if (v_18->hd.t0.tag == 54) {
                        _fx_N14Lexer__token_t* v_19 = &v_17->hd.t0;
                        if (v_19->tag == 2) {
                           _fx_R16Ast__val_flags_t v_20 = {0};
                           _fx_T2BS* vcase_1 = &v_19->u.IDENT;
                           FX_CALL(_fx_M3AstFM17default_var_flagsRM11val_flags_t0(&v_20, 0), _fx_catch_4);
                           _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t(v_18->tl, vcase_1->t0,
                              &vcase_1->t1, &v_20, &v_8);

                        _fx_catch_4: ;
                           _fx_free_R16Ast__val_flags_t(&v_20);
                           goto _fx_endmatch_1;
                        }
                     }
                  }
               }
            }
         }
         if (ts_2 != 0) {
            if (ts_2->hd.t0.tag == 38) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_21 = ts_2->tl;
               if (v_21 != 0) {
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t v_22 = v_21->tl;
                  if (v_22 != 0) {
                     if (v_22->hd.t0.tag == 54) {
                        _fx_N14Lexer__token_t* v_23 = &v_21->hd.t0;
                        if (v_23->tag == 2) {
                           _fx_R16Ast__val_flags_t v_24 = {0};
                           _fx_T2BS* vcase_2 = &v_23->u.IDENT;
                           FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_24, 0), _fx_catch_5);
                           _fx_make_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t(v_22->tl, vcase_2->t0,
                              &vcase_2->t1, &v_24, &v_8);

                        _fx_catch_5: ;
                           _fx_free_R16Ast__val_flags_t(&v_24);
                           goto _fx_endmatch_1;
                        }
                     }
                  }
               }
            }
         }
         fx_exn_t v_25 = {0};
         _fx_R10Ast__loc_t loc_2;
         if (ts_2 != 0) {
            loc_2 = ts_2->hd.t1;
         }
         else {
            loc_2 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_6);
         fx_str_t slit_2 = FX_MAKE_STR("unexpected token");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_25), _fx_catch_6);
         FX_THROW(&v_25, true, _fx_catch_6);

      _fx_catch_6: ;
         fx_free_exn(&v_25);

      _fx_endmatch_1: ;
         FX_CHECK_EXN(_fx_catch_9);
         FX_COPY_PTR(v_8.t0, &ts_3);
         bool f_0 = v_8.t1;
         fx_copy_str(&v_8.t2, &i_0);
         _fx_copy_R16Ast__val_flags_t(&v_8.t3, &flags_0);
         bool t_1;
         if (expect_semicolon_2) {
            t_1 = !f_0;
         }
         else {
            t_1 = false;
         }
         if (t_1) {
            _fx_R10Ast__loc_t loc_3;
            if (ts_3 != 0) {
               loc_3 = ts_3->hd.t1;
            }
            else {
               loc_3 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_9);
            fx_str_t slit_3 = FX_MAKE_STR("\';\' or newline should be inserted between record elements");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_3, &v_9), _fx_catch_9);
            FX_THROW(&v_9, true, _fx_catch_9);
         }
         FX_CALL(
            _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_3, &v_10, 0), _fx_catch_9);
         FX_COPY_PTR(v_10.t0, &ts_4);
         FX_COPY_PTR(v_10.t1, &t_0);
         if (ts_4 != 0) {
            if (ts_4->hd.t0.tag == 86) {
               _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t v_26 = {0};
               _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
               _fx_N10Ast__exp_t v0_0 = 0;
               FX_CALL(
                  _fx_M6ParserFM9parse_expT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
                     ts_4->tl, true, &v_26, 0), _fx_catch_7);
               FX_COPY_PTR(v_26.t0, &ts_6);
               FX_COPY_PTR(v_26.t1, &v0_0);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_6, v0_0, &v_11);

            _fx_catch_7: ;
               if (v0_0) {
                  _fx_free_N10Ast__exp_t(&v0_0);
               }
               if (ts_6) {
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
               }
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_26);
               goto _fx_endmatch_2;
            }
         }
         if (ts_4 != 0) {
            _fx_N10Ast__exp_t v_27 = 0;
            FX_CALL(_fx_M3AstFM6ExpNopN10Ast__exp_t1RM5loc_t(&ts_4->hd.t1, &v_27), _fx_catch_8);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_4, v_27, &v_11);

         _fx_catch_8: ;
            if (v_27) {
               _fx_free_N10Ast__exp_t(&v_27);
            }
            goto _fx_endmatch_2;
         }
         FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_9);

      _fx_endmatch_2: ;
         FX_CHECK_EXN(_fx_catch_9);
         FX_COPY_PTR(v_11.t0, &ts_5);
         FX_COPY_PTR(v_11.t1, &default__0);
         _fx_R9Ast__id_t v_28;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&i_0, &v_28, 0), _fx_catch_9);
         _fx_make_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&flags_0, &v_28, t_0, default__0, &v_12);
         FX_CALL(_fx_cons_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&v_12, result_3, true, &v_13),
            _fx_catch_9);
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         FX_COPY_PTR(ts_5, &ts_1);
         expect_semicolon_1 = true;
         _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&result_2);
         FX_COPY_PTR(v_13, &result_2);

      _fx_catch_9: ;
         if (v_13) {
            _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&v_13);
         }
         _fx_free_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&v_12);
         if (default__0) {
            _fx_free_N10Ast__exp_t(&default__0);
         }
         if (ts_5) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(&v_11);
         if (t_0) {
            _fx_free_N10Ast__typ_t(&t_0);
         }
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_10);
         fx_free_exn(&v_9);
         _fx_free_R16Ast__val_flags_t(&flags_0);
         FX_FREE_STR(&i_0);
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T4LT2N14Lexer__token_tR10Ast__loc_tBSR16Ast__val_flags_t(&v_8);
         goto _fx_endmatch_3;
      }
      fx_str_t v_29 = {0};
      fx_exn_t v_30 = {0};
      if (expect_semicolon_2) {
         fx_str_t slit_4 = FX_MAKE_STR("\';\' or newline is expected"); fx_copy_str(&slit_4, &v_29);
      }
      else {
         fx_str_t slit_5 = FX_MAKE_STR("identifier followed by \':\' is expected"); fx_copy_str(&slit_5, &v_29);
      }
      _fx_R10Ast__loc_t loc_4;
      if (ts_2 != 0) {
         loc_4 = ts_2->hd.t1;
      }
      else {
         loc_4 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_10);
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_4, &v_29, &v_30), _fx_catch_10);
      FX_THROW(&v_30, true, _fx_catch_10);

   _fx_catch_10: ;
      fx_free_exn(&v_30);
      FX_FREE_STR(&v_29);

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_11);

   _fx_catch_11: ;
      if (result_3) {
         _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&result_1,
      fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM24parse_typespec_or_recordT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_0 = ts_0->tl;
      if (v_0 != 0) {
         if (ts_0->hd.t0.tag == 49) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_1 = v_0->tl;
            if (v_1 != 0) {
               if (v_0->hd.t0.tag == 14) {
                  if (v_1->hd.t0.tag == 50) {
                     fx_exn_t v_2 = {0};
                     _fx_R10Ast__loc_t loc_0;
                     if (ts_0 != 0) {
                        loc_0 = ts_0->hd.t1;
                     }
                     else {
                        loc_0 = _fx_g18Parser__parser_ctx.default_loc;
                     }
                     FX_CHECK_EXN(_fx_catch_0);
                     fx_str_t slit_0 =
                        FX_MAKE_STR("\'{...}\' cannot be used inside type definitions, only for function parameters");
                     FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_2), _fx_catch_0);
                     FX_THROW(&v_2, true, _fx_catch_0);

                  _fx_catch_0: ;
                     fx_free_exn(&v_2);
                     goto _fx_endmatch_0;
                  }
               }
            }
         }
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 49) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t v_3 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
         _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_0 = 0;
         _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_4 = {0};
         _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_5 = 0;
         _fx_N10Ast__typ_t v_6 = 0;
         FX_CALL(
            _fx_M6ParserFM13parse_relems_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t3LT2N14Lexer__token_tR10Ast__loc_tBLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
               ts_0->tl, false, 0, &v_3, 0), _fx_catch_1);
         FX_COPY_PTR(v_3.t0, &ts_1);
         FX_COPY_PTR(v_3.t1, &relems_0);
         _fx_make_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(relems_0, true, &v_4);
         FX_CALL(_fx_make_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_4, &v_5), _fx_catch_1);
         FX_CALL(_fx_M3AstFM9TypRecordN10Ast__typ_t1rT2LT4RM11val_flags_tRM4id_tN10Ast__typ_tN10Ast__exp_tB(v_5, &v_6),
            _fx_catch_1);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(ts_1, v_6, fx_result);

      _fx_catch_1: ;
         if (v_6) {
            _fx_free_N10Ast__typ_t(&v_6);
         }
         if (v_5) {
            _fx_free_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_5);
         }
         _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_4);
         if (relems_0) {
            _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_0);
         }
         if (ts_1) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&v_3);
         goto _fx_endmatch_0;
      }
   }
   FX_CALL(
      _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_0,
         fx_result, 0), _fx_catch_2);

_fx_catch_2: ;

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM13parse_tyvars_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t4LT2N14Lexer__token_tR10Ast__loc_tBLR9Ast__id_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_comma_0,
   struct _fx_LR9Ast__id_t_data_t* tyvars_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t result_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LR9Ast__id_t tyvars_1 = 0;
   int fx_status = 0;
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_comma_1 = expect_comma_0;
   FX_COPY_PTR(tyvars_0, &tyvars_1);
   _fx_R10Ast__loc_t loc_1 = *loc_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LR9Ast__id_t tyvars_2 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_comma_2 = expect_comma_1;
      FX_COPY_PTR(tyvars_1, &tyvars_2);
      _fx_R10Ast__loc_t loc_2 = loc_1;
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 51) {
            fx_exn_t v_0 = {0};
            if (expect_comma_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_comma_1 = false;
               FX_FREE_LIST_SIMPLE(&tyvars_1);
               FX_COPY_PTR(tyvars_2, &tyvars_1);
               loc_1 = loc_2;
            }
            else {
               _fx_R10Ast__loc_t loc_3;
               if (ts_2 != 0) {
                  loc_3 = ts_2->hd.t1;
               }
               else {
                  loc_3 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \',\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_1 = &ts_2->hd.t0;
         if (v_1->tag == 3) {
            fx_exn_t v_2 = {0};
            _fx_LR9Ast__id_t v_3 = 0;
            if (expect_comma_2) {
               _fx_R10Ast__loc_t loc_4;
               if (ts_2 != 0) {
                  loc_4 = ts_2->hd.t1;
               }
               else {
                  loc_4 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_1);
               fx_str_t slit_1 = FX_MAKE_STR("\',\' is expected");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_4, &slit_1, &v_2), _fx_catch_1);
               FX_THROW(&v_2, true, _fx_catch_1);
            }
            _fx_R9Ast__id_t v_4;
            FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_1->u.TYVAR, &v_4, 0), _fx_catch_1);
            FX_CALL(_fx_cons_LR9Ast__id_t(&v_4, tyvars_2, true, &v_3), _fx_catch_1);
            _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &ts_2->tl;
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(*rest_1, &ts_1);
            expect_comma_1 = true;
            FX_FREE_LIST_SIMPLE(&tyvars_1);
            FX_COPY_PTR(v_3, &tyvars_1);
            loc_1 = loc_2;

         _fx_catch_1: ;
            FX_FREE_LIST_SIMPLE(&v_3);
            fx_free_exn(&v_2);
            goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 46) {
            _fx_LR9Ast__id_t __fold_result___0 = 0;
            _fx_LR9Ast__id_t v_5 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t result_1 = {0};
            _fx_LR9Ast__id_t lst_0 = tyvars_2;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_LR9Ast__id_t r_0 = 0;
               _fx_R9Ast__id_t* a_0 = &lst_0->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LR9Ast__id_t(a_0, r_0, false, &r_0), _fx_catch_2);
               FX_FREE_LIST_SIMPLE(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_2: ;
               FX_FREE_LIST_SIMPLE(&r_0);
               FX_CHECK_EXN(_fx_catch_3);
            }
            FX_COPY_PTR(__fold_result___0, &v_5);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(ts_2->tl, v_5, &result_1);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_0);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_1, &result_0);
            FX_BREAK(_fx_catch_3);

         _fx_catch_3: ;
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_1);
            FX_FREE_LIST_SIMPLE(&v_5);
            FX_FREE_LIST_SIMPLE(&__fold_result___0);
            goto _fx_endmatch_0;
         }
      }
      fx_str_t v_6 = {0};
      fx_str_t v_7 = {0};
      fx_exn_t v_8 = {0};
      FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(&loc_2, &v_6, 0), _fx_catch_4);
      fx_str_t slit_2 = FX_MAKE_STR("incomplete type var list started at ");
      fx_str_t slit_3 = FX_MAKE_STR(", \')\' is missing?");
      {
         const fx_str_t strs_0[] = { slit_2, v_6, slit_3 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_7), _fx_catch_4);
      }
      _fx_R10Ast__loc_t loc_5;
      if (ts_2 != 0) {
         loc_5 = ts_2->hd.t1;
      }
      else {
         loc_5 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_4);
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_5, &v_7, &v_8), _fx_catch_4);
      FX_THROW(&v_8, true, _fx_catch_4);

   _fx_catch_4: ;
      fx_free_exn(&v_8);
      FX_FREE_STR(&v_7);
      FX_FREE_STR(&v_6);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_5);

   _fx_catch_5: ;
      FX_FREE_LIST_SIMPLE(&tyvars_2);
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&result_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   FX_FREE_LIST_SIMPLE(&tyvars_1);
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM12parse_cases_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t3LT2N14Lexer__token_tR10Ast__loc_tBLT2R9Ast__id_tN10Ast__typ_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool expect_bar_0,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* result_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LT2R9Ast__id_tN10Ast__typ_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool expect_bar_1 = expect_bar_0;
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT2R9Ast__id_tN10Ast__typ_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      bool expect_bar_2 = expect_bar_1;
      FX_COPY_PTR(result_2, &result_3);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 81) {
            fx_exn_t v_0 = {0};
            if (expect_bar_2) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_0 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_0, &ts_1);
               expect_bar_1 = false;
               _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&result_2);
               FX_COPY_PTR(result_3, &result_2);
            }
            else {
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("extra \'|\'?");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
               FX_THROW(&v_0, true, _fx_catch_0);
            }

         _fx_catch_0: ;
            fx_free_exn(&v_0);
            goto _fx_endmatch_0;
         }
      }
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_1 = ts_2->tl;
         if (v_1 != 0) {
            if (v_1->hd.t0.tag == 54) {
               _fx_N14Lexer__token_t* v_2 = &ts_2->hd.t0;
               if (v_2->tag == 2) {
                  _fx_LT2R9Ast__id_tN10Ast__typ_t __fold_result___0 = 0;
                  _fx_LT2R9Ast__id_tN10Ast__typ_t v_3 = 0;
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t result_4 = {0};
                  fx_exn_t v_4 = {0};
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_5 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
                  _fx_N10Ast__typ_t t_0 = 0;
                  _fx_T2R9Ast__id_tN10Ast__typ_t v_6 = {0};
                  _fx_LT2R9Ast__id_tN10Ast__typ_t v_7 = 0;
                  fx_str_t* i_0 = &v_2->u.IDENT.t1;
                  if (expect_bar_2) {
                     _fx_LT2R9Ast__id_tN10Ast__typ_t lst_0 = result_3;
                     for (; lst_0; lst_0 = lst_0->tl) {
                        _fx_LT2R9Ast__id_tN10Ast__typ_t r_0 = 0;
                        _fx_T2R9Ast__id_tN10Ast__typ_t* a_0 = &lst_0->hd;
                        FX_COPY_PTR(__fold_result___0, &r_0);
                        FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__typ_t(a_0, r_0, false, &r_0), _fx_catch_1);
                        _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&__fold_result___0);
                        FX_COPY_PTR(r_0, &__fold_result___0);

                     _fx_catch_1: ;
                        if (r_0) {
                           _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&r_0);
                        }
                        FX_CHECK_EXN(_fx_catch_2);
                     }
                     FX_COPY_PTR(__fold_result___0, &v_3);
                     _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(ts_2, v_3, &result_4);
                     _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_1);
                     _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_4, &result_1);
                     FX_BREAK(_fx_catch_2);
                  }
                  else {
                     FX_STR_CHKIDX(*i_0, 0, _fx_catch_2);
                     char_ c_0 = FX_STR_ELEM(*i_0, 0);
                     bool v_8;
                     if ((bool)(((char_)65 <= c_0) & (c_0 <= (char_)90))) {
                        v_8 = true;
                     }
                     else {
                        v_8 = _fx_M6StringFM8containsB2SC(i_0, (char_)46, 0);
                     }
                     if (!v_8) {
                        _fx_R10Ast__loc_t loc_1;
                        if (ts_2 != 0) {
                           loc_1 = ts_2->hd.t1;
                        }
                        else {
                           loc_1 = _fx_g18Parser__parser_ctx.default_loc;
                        }
                        FX_CHECK_EXN(_fx_catch_2);
                        fx_str_t slit_1 = FX_MAKE_STR("variant label should start with a capital letter A..Z");
                        FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_4), _fx_catch_2);
                        FX_THROW(&v_4, true, _fx_catch_2);
                     }
                     FX_CALL(
                        _fx_M6ParserFM24parse_typespec_or_recordT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
                           v_1->tl, &v_5, 0), _fx_catch_2);
                     FX_COPY_PTR(v_5.t0, &ts_3);
                     FX_COPY_PTR(v_5.t1, &t_0);
                     _fx_R9Ast__id_t v_9;
                     FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(i_0, &v_9, 0), _fx_catch_2);
                     _fx_make_T2R9Ast__id_tN10Ast__typ_t(&v_9, t_0, &v_6);
                     FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__typ_t(&v_6, result_3, true, &v_7), _fx_catch_2);
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                     FX_COPY_PTR(ts_3, &ts_1);
                     expect_bar_1 = true;
                     _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&result_2);
                     FX_COPY_PTR(v_7, &result_2);
                  }

               _fx_catch_2: ;
                  if (v_7) {
                     _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&v_7);
                  }
                  _fx_free_T2R9Ast__id_tN10Ast__typ_t(&v_6);
                  if (t_0) {
                     _fx_free_N10Ast__typ_t(&t_0);
                  }
                  if (ts_3) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_5);
                  fx_free_exn(&v_4);
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_4);
                  if (v_3) {
                     _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&v_3);
                  }
                  if (__fold_result___0) {
                     _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&__fold_result___0);
                  }
                  goto _fx_endmatch_0;
               }
            }
         }
      }
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_10 = &ts_2->hd.t0;
         if (v_10->tag == 2) {
            _fx_LT2R9Ast__id_tN10Ast__typ_t __fold_result___1 = 0;
            _fx_LT2R9Ast__id_tN10Ast__typ_t v_11 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t result_5 = {0};
            fx_exn_t v_12 = {0};
            _fx_T2R9Ast__id_tN10Ast__typ_t v_13 = {0};
            _fx_LT2R9Ast__id_tN10Ast__typ_t v_14 = 0;
            fx_str_t* i_1 = &v_10->u.IDENT.t1;
            if (expect_bar_2) {
               _fx_LT2R9Ast__id_tN10Ast__typ_t lst_1 = result_3;
               for (; lst_1; lst_1 = lst_1->tl) {
                  _fx_LT2R9Ast__id_tN10Ast__typ_t r_1 = 0;
                  _fx_T2R9Ast__id_tN10Ast__typ_t* a_1 = &lst_1->hd;
                  FX_COPY_PTR(__fold_result___1, &r_1);
                  FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__typ_t(a_1, r_1, false, &r_1), _fx_catch_3);
                  _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&__fold_result___1);
                  FX_COPY_PTR(r_1, &__fold_result___1);

               _fx_catch_3: ;
                  if (r_1) {
                     _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&r_1);
                  }
                  FX_CHECK_EXN(_fx_catch_4);
               }
               FX_COPY_PTR(__fold_result___1, &v_11);
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(ts_2, v_11, &result_5);
               _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_1);
               _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_5, &result_1);
               FX_BREAK(_fx_catch_4);
            }
            else {
               FX_STR_CHKIDX(*i_1, 0, _fx_catch_4);
               char_ c_1 = FX_STR_ELEM(*i_1, 0);
               bool v_15;
               if ((bool)(((char_)65 <= c_1) & (c_1 <= (char_)90))) {
                  v_15 = true;
               }
               else {
                  v_15 = _fx_M6StringFM8containsB2SC(i_1, (char_)46, 0);
               }
               if (!v_15) {
                  _fx_R10Ast__loc_t loc_2;
                  if (ts_2 != 0) {
                     loc_2 = ts_2->hd.t1;
                  }
                  else {
                     loc_2 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_4);
                  fx_str_t slit_2 = FX_MAKE_STR("variant label should start with a capital letter A..Z");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_12), _fx_catch_4);
                  FX_THROW(&v_12, true, _fx_catch_4);
               }
               _fx_R9Ast__id_t v_16;
               FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(i_1, &v_16, 0), _fx_catch_4);
               _fx_make_T2R9Ast__id_tN10Ast__typ_t(&v_16, _fx_g15Parser__TypVoid, &v_13);
               FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__typ_t(&v_13, result_3, true, &v_14), _fx_catch_4);
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_1 = &ts_2->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_1, &ts_1);
               expect_bar_1 = true;
               _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&result_2);
               FX_COPY_PTR(v_14, &result_2);
            }

         _fx_catch_4: ;
            if (v_14) {
               _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&v_14);
            }
            _fx_free_T2R9Ast__id_tN10Ast__typ_t(&v_13);
            fx_free_exn(&v_12);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_5);
            if (v_11) {
               _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&v_11);
            }
            if (__fold_result___1) {
               _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&__fold_result___1);
            }
            goto _fx_endmatch_0;
         }
      }
      _fx_LT2R9Ast__id_tN10Ast__typ_t __fold_result___2 = 0;
      _fx_LT2R9Ast__id_tN10Ast__typ_t v_17 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t result_6 = {0};
      _fx_LT2R9Ast__id_tN10Ast__typ_t lst_2 = result_3;
      for (; lst_2; lst_2 = lst_2->tl) {
         _fx_LT2R9Ast__id_tN10Ast__typ_t r_2 = 0;
         _fx_T2R9Ast__id_tN10Ast__typ_t* a_2 = &lst_2->hd;
         FX_COPY_PTR(__fold_result___2, &r_2);
         FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__typ_t(a_2, r_2, false, &r_2), _fx_catch_5);
         _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&__fold_result___2);
         FX_COPY_PTR(r_2, &__fold_result___2);

      _fx_catch_5: ;
         if (r_2) {
            _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&r_2);
         }
         FX_CHECK_EXN(_fx_catch_6);
      }
      FX_COPY_PTR(__fold_result___2, &v_17);
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(ts_2, v_17, &result_6);
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_1);
      _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_6, &result_1);
      FX_BREAK(_fx_catch_6);

   _fx_catch_6: ;
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_6);
      if (v_17) {
         _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&v_17);
      }
      if (__fold_result___2) {
         _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&__fold_result___2);
      }

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_7);

   _fx_catch_7: ;
      if (result_3) {
         _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&result_3);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (result_2) {
      _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM13parse_deftypeT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_ti v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t v_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
   _fx_LR9Ast__id_t type_params_0 = 0;
   _fx_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t v_2 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t v_3 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
   _fx_LT2R9Ast__id_tLTa2R9Ast__id_t ifaces_0 = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 10) {
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_ti(ts_0->tl, _fx_g18Parser__parser_ctx.m_idx, &v_0); goto _fx_endmatch_0;
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 37) {
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_ti(ts_0->tl, 0, &v_0); goto _fx_endmatch_0;
      }
   }
   fx_exn_t v_4 = {0};
   _fx_R10Ast__loc_t loc_0;
   if (ts_0 != 0) {
      loc_0 = ts_0->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_0);
   fx_str_t slit_0 = FX_MAKE_STR("\'type\' or \'class\' is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_4), _fx_catch_0);
   FX_THROW(&v_4, true, _fx_catch_0);

_fx_catch_0: ;
   fx_free_exn(&v_4);

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   int_ class_module_0 = v_0.t1;
   if (ts_1 != 0) {
      _fx_N14Lexer__token_t* v_5 = &ts_1->hd.t0;
      if (v_5->tag == 3) {
         _fx_LR9Ast__id_t v_6 = 0;
         _fx_R9Ast__id_t v_7;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_5->u.TYVAR, &v_7, 0), _fx_catch_1);
         FX_CALL(_fx_cons_LR9Ast__id_t(&v_7, 0, true, &v_6), _fx_catch_1);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(ts_1->tl, v_6, &v_1);

      _fx_catch_1: ;
         FX_FREE_LIST_SIMPLE(&v_6);
         goto _fx_endmatch_1;
      }
   }
   if (ts_1 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_8 = &ts_1->hd;
      if (v_8->t0.tag == 44) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t v_9 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
         _fx_LR9Ast__id_t type_params_1 = 0;
         fx_exn_t v_10 = {0};
         FX_CALL(
            _fx_M6ParserFM13parse_tyvars_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t4LT2N14Lexer__token_tR10Ast__loc_tBLR9Ast__id_tR10Ast__loc_t(
               ts_1->tl, false, 0, &v_8->t1, &v_9, 0), _fx_catch_2);
         FX_COPY_PTR(v_9.t0, &ts_6);
         FX_COPY_PTR(v_9.t1, &type_params_1);
         if (type_params_1 == 0) {
            _fx_R10Ast__loc_t loc_1;
            if (ts_6 != 0) {
               loc_1 = ts_6->hd.t1;
            }
            else {
               loc_1 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_2);
            fx_str_t slit_1 =
               FX_MAKE_STR("empty list of type parameters inside (); if you don\'t want type parameters, just remove ()");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_10), _fx_catch_2);
            FX_THROW(&v_10, true, _fx_catch_2);
         }
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(ts_6, type_params_1, &v_1);

      _fx_catch_2: ;
         fx_free_exn(&v_10);
         FX_FREE_LIST_SIMPLE(&type_params_1);
         if (ts_6) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&v_9);
         goto _fx_endmatch_1;
      }
   }
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(ts_1, 0, &v_1);

_fx_endmatch_1: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_1.t0, &ts_2);
   FX_COPY_PTR(v_1.t1, &type_params_0);
   if (ts_2 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_11 = &ts_2->hd;
      _fx_N14Lexer__token_t* v_12 = &v_11->t0;
      if (v_12->tag == 2) {
         _fx_R9Ast__id_t v_13;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_12->u.IDENT.t1, &v_13, 0), _fx_catch_3);
         _fx_make_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t(ts_2->tl, &v_13, &v_11->t1, &v_2);

      _fx_catch_3: ;
         goto _fx_endmatch_2;
      }
   }
   fx_exn_t v_14 = {0};
   _fx_R10Ast__loc_t loc_2;
   if (ts_2 != 0) {
      loc_2 = ts_2->hd.t1;
   }
   else {
      loc_2 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_4);
   fx_str_t slit_2 = FX_MAKE_STR("the type name is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_14), _fx_catch_4);
   FX_THROW(&v_14, true, _fx_catch_4);

_fx_catch_4: ;
   fx_free_exn(&v_14);

_fx_endmatch_2: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_2.t0, &ts_3);
   _fx_R9Ast__id_t tname_0 = v_2.t1;
   _fx_R10Ast__loc_t loc_3 = v_2.t2;
   if (ts_3 != 0) {
      if (ts_3->hd.t0.tag == 54) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t v_15 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_7 = 0;
         _fx_LR9Ast__id_t ifaces_1 = 0;
         _fx_LT2R9Ast__id_tLTa2R9Ast__id_t v_16 = 0;
         FX_CALL(
            _fx_M6ParserFM16parse_ident_listT2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t4LT2N14Lexer__token_tR10Ast__loc_tBBLR9Ast__id_t(
               ts_3->tl, false, true, 0, &v_15, 0), _fx_catch_6);
         FX_COPY_PTR(v_15.t0, &ts_7);
         FX_COPY_PTR(v_15.t1, &ifaces_1);
         _fx_LT2R9Ast__id_tLTa2R9Ast__id_t lstend_0 = 0;
         _fx_LR9Ast__id_t lst_0 = ifaces_1;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_T2R9Ast__id_tLTa2R9Ast__id_t tup_0 = {0};
            _fx_R9Ast__id_t* i_0 = &lst_0->hd;
            _fx_make_T2R9Ast__id_tLTa2R9Ast__id_t(i_0, 0, &tup_0);
            _fx_LT2R9Ast__id_tLTa2R9Ast__id_t node_0 = 0;
            FX_CALL(_fx_cons_LT2R9Ast__id_tLTa2R9Ast__id_t(&tup_0, 0, false, &node_0), _fx_catch_5);
            FX_LIST_APPEND(v_16, lstend_0, node_0);

         _fx_catch_5: ;
            _fx_free_T2R9Ast__id_tLTa2R9Ast__id_t(&tup_0);
            FX_CHECK_EXN(_fx_catch_6);
         }
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t(ts_7, v_16, &v_3);

      _fx_catch_6: ;
         if (v_16) {
            _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(&v_16);
         }
         FX_FREE_LIST_SIMPLE(&ifaces_1);
         if (ts_7) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_7);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&v_15);
         goto _fx_endmatch_3;
      }
   }
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t(ts_3, 0, &v_3);

_fx_endmatch_3: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_3.t0, &ts_4);
   FX_COPY_PTR(v_3.t1, &ifaces_0);
   if (ts_4 != 0) {
      if (ts_4->hd.t0.tag == 86) {
         FX_COPY_PTR(ts_4->tl, &ts_5); goto _fx_endmatch_4;
      }
   }
   if (ts_4 != 0) {
      if (ts_4->hd.t0.tag == 49) {
         FX_COPY_PTR(ts_4, &ts_5); goto _fx_endmatch_4;
      }
   }
   fx_exn_t v_17 = {0};
   _fx_R10Ast__loc_t loc_4;
   if (ts_4 != 0) {
      loc_4 = ts_4->hd.t1;
   }
   else {
      loc_4 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_7);
   fx_str_t slit_3 = FX_MAKE_STR("\'=\' or \'{\' is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_4, &slit_3, &v_17), _fx_catch_7);
   FX_THROW(&v_17, true, _fx_catch_7);

_fx_catch_7: ;
   fx_free_exn(&v_17);

_fx_endmatch_4: ;
   FX_CHECK_EXN(_fx_cleanup);
   if (ts_5 != 0) {
      if (ts_5->hd.t0.tag == 49) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_18 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_8 = 0;
         _fx_N10Ast__typ_t t_0 = 0;
         _fx_T2R9Ast__id_tN10Ast__typ_t v_19 = {0};
         _fx_LT2R9Ast__id_tN10Ast__typ_t cases_0 = 0;
         _fx_N10Ast__typ_t v_20 = 0;
         _fx_rLR9Ast__id_t v_21 = 0;
         _fx_R17Ast__defvariant_t v_22 = {0};
         _fx_rR17Ast__defvariant_t dvar_0 = 0;
         _fx_N10Ast__exp_t v_23 = 0;
         FX_CALL(
            _fx_M6ParserFM24parse_typespec_or_recordT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(
               ts_5, &v_18, 0), _fx_catch_11);
         FX_COPY_PTR(v_18.t0, &ts_8);
         FX_COPY_PTR(v_18.t1, &t_0);
         _fx_make_T2R9Ast__id_tN10Ast__typ_t(&tname_0, t_0, &v_19);
         FX_CALL(_fx_cons_LT2R9Ast__id_tN10Ast__typ_t(&v_19, 0, true, &cases_0), _fx_catch_11);
         bool __fold_result___0 = false;
         _fx_LT2R9Ast__id_tN10Ast__typ_t lst_1 = cases_0;
         for (; lst_1; lst_1 = lst_1->tl) {
            _fx_T2R9Ast__id_tN10Ast__typ_t* __pat___0 = &lst_1->hd;
            _fx_N10Ast__typ_t v_24 = __pat___0->t1;
            bool v_25;
            if (FX_REC_VARIANT_TAG(v_24) == 20) {
               _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_26 = {0};
               _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_0 = 0;
               _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_24->u.TypRecord->data, &v_26);
               bool __fold_result___1 = false;
               FX_COPY_PTR(v_26.t0, &relems_0);
               _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_2 = relems_0;
               for (; lst_2; lst_2 = lst_2->tl) {
                  _fx_R16Ast__val_flags_t flags_0 = {0};
                  _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* __pat___1 = &lst_2->hd;
                  _fx_copy_R16Ast__val_flags_t(&__pat___1->t0, &flags_0);
                  if (flags_0.val_flag_mutable) {
                     __fold_result___1 = true; FX_BREAK(_fx_catch_8);
                  }

               _fx_catch_8: ;
                  _fx_free_R16Ast__val_flags_t(&flags_0);
                  FX_CHECK_BREAK();
                  FX_CHECK_EXN(_fx_catch_9);
               }
               v_25 = __fold_result___1;

            _fx_catch_9: ;
               if (relems_0) {
                  _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_0);
               }
               _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_26);
            }
            else {
               v_25 = false;
            }
            FX_CHECK_EXN(_fx_catch_10);
            if (v_25) {
               __fold_result___0 = true; FX_BREAK(_fx_catch_10);
            }

         _fx_catch_10: ;
            FX_CHECK_BREAK();
            FX_CHECK_EXN(_fx_catch_11);
         }
         bool hm_0 = __fold_result___0;
         FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_20, 0), _fx_catch_11);
         _fx_R16Ast__var_flags_t v_27;
         FX_CALL(_fx_M3AstFM21default_variant_flagsRM11var_flags_t0(&v_27, 0), _fx_catch_11);
         bool t_1;
         if (ifaces_0 == 0) {
            t_1 = !hm_0;
         }
         else {
            t_1 = false;
         }
         _fx_R16Ast__var_flags_t v_28 =
            { class_module_0, t_1, v_27.var_flag_recursive, v_27.var_flag_have_tag, hm_0, v_27.var_flag_opt,
               v_27.var_flag_instance };
         FX_CALL(_fx_make_rLR9Ast__id_t(0, &v_21), _fx_catch_11);
         _fx_make_R17Ast__defvariant_t(&tname_0, type_params_0, v_20, &v_28, cases_0, 0, v_21, ifaces_0, 0, &loc_3, &v_22);
         FX_CALL(_fx_make_rR17Ast__defvariant_t(&v_22, &dvar_0), _fx_catch_11);
         FX_CALL(_fx_M3AstFM10DefVariantN10Ast__exp_t1rRM12defvariant_t(dvar_0, &v_23), _fx_catch_11);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_8, v_23, fx_result);

      _fx_catch_11: ;
         if (v_23) {
            _fx_free_N10Ast__exp_t(&v_23);
         }
         if (dvar_0) {
            _fx_free_rR17Ast__defvariant_t(&dvar_0);
         }
         _fx_free_R17Ast__defvariant_t(&v_22);
         if (v_21) {
            _fx_free_rLR9Ast__id_t(&v_21);
         }
         if (v_20) {
            _fx_free_N10Ast__typ_t(&v_20);
         }
         if (cases_0) {
            _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&cases_0);
         }
         _fx_free_T2R9Ast__id_tN10Ast__typ_t(&v_19);
         if (t_0) {
            _fx_free_N10Ast__typ_t(&t_0);
         }
         if (ts_8) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_8);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_18);
         goto _fx_endmatch_7;
      }
   }
   bool res_0;
   if (ts_5 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_29 = ts_5->tl;
      if (v_29 != 0) {
         if (ts_5->hd.t0.tag == 81) {
            if (v_29->hd.t0.tag == 2) {
               res_0 = true; goto _fx_endmatch_5;
            }
         }
      }
   }
   if (ts_5 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_30 = ts_5->tl;
      if (v_30 != 0) {
         if (ts_5->hd.t0.tag == 2) {
            if (v_30->hd.t0.tag == 81) {
               res_0 = true; goto _fx_endmatch_5;
            }
         }
      }
   }
   if (ts_5 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_31 = ts_5->tl;
      if (v_31 != 0) {
         if (ts_5->hd.t0.tag == 2) {
            if (v_31->hd.t0.tag == 54) {
               res_0 = true; goto _fx_endmatch_5;
            }
         }
      }
   }
   res_0 = false;

_fx_endmatch_5: ;
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_9 = 0;
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t v_32 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_10 = 0;
      _fx_LT2R9Ast__id_tN10Ast__typ_t cases_1 = 0;
      _fx_N10Ast__typ_t v_33 = 0;
      _fx_rLR9Ast__id_t v_34 = 0;
      _fx_R17Ast__defvariant_t v_35 = {0};
      _fx_rR17Ast__defvariant_t dvar_1 = 0;
      _fx_N10Ast__exp_t v_36 = 0;
      if (ts_5 != 0) {
         if (ts_5->hd.t0.tag == 81) {
            FX_COPY_PTR(ts_5->tl, &ts_9); goto _fx_endmatch_6;
         }
      }
      FX_COPY_PTR(ts_5, &ts_9);

   _fx_endmatch_6: ;
      FX_CHECK_EXN(_fx_catch_15);
      FX_CALL(
         _fx_M6ParserFM12parse_cases_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t3LT2N14Lexer__token_tR10Ast__loc_tBLT2R9Ast__id_tN10Ast__typ_t(
            ts_9, false, 0, &v_32, 0), _fx_catch_15);
      FX_COPY_PTR(v_32.t0, &ts_10);
      FX_COPY_PTR(v_32.t1, &cases_1);
      FX_CALL(_fx_M3AstFM12make_new_typN10Ast__typ_t0(&v_33, 0), _fx_catch_15);
      _fx_R16Ast__var_flags_t v_37;
      FX_CALL(_fx_M3AstFM21default_variant_flagsRM11var_flags_t0(&v_37, 0), _fx_catch_15);
      bool __fold_result___2 = false;
      _fx_LT2R9Ast__id_tN10Ast__typ_t lst_3 = cases_1;
      for (; lst_3; lst_3 = lst_3->tl) {
         _fx_T2R9Ast__id_tN10Ast__typ_t* __pat___2 = &lst_3->hd;
         _fx_N10Ast__typ_t v_38 = __pat___2->t1;
         bool v_39;
         if (FX_REC_VARIANT_TAG(v_38) == 20) {
            _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB v_40 = {0};
            _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t relems_1 = 0;
            _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_38->u.TypRecord->data, &v_40);
            bool __fold_result___3 = false;
            FX_COPY_PTR(v_40.t0, &relems_1);
            _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t lst_4 = relems_1;
            for (; lst_4; lst_4 = lst_4->tl) {
               _fx_R16Ast__val_flags_t flags_1 = {0};
               _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* __pat___3 = &lst_4->hd;
               _fx_copy_R16Ast__val_flags_t(&__pat___3->t0, &flags_1);
               if (flags_1.val_flag_mutable) {
                  __fold_result___3 = true; FX_BREAK(_fx_catch_12);
               }

            _fx_catch_12: ;
               _fx_free_R16Ast__val_flags_t(&flags_1);
               FX_CHECK_BREAK();
               FX_CHECK_EXN(_fx_catch_13);
            }
            v_39 = __fold_result___3;

         _fx_catch_13: ;
            if (relems_1) {
               _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&relems_1);
            }
            _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&v_40);
         }
         else {
            v_39 = false;
         }
         FX_CHECK_EXN(_fx_catch_14);
         if (v_39) {
            __fold_result___2 = true; FX_BREAK(_fx_catch_14);
         }

      _fx_catch_14: ;
         FX_CHECK_BREAK();
         FX_CHECK_EXN(_fx_catch_15);
      }
      _fx_R16Ast__var_flags_t v_41 =
         { class_module_0, false, v_37.var_flag_recursive, v_37.var_flag_have_tag, __fold_result___2, v_37.var_flag_opt,
            v_37.var_flag_instance };
      FX_CALL(_fx_make_rLR9Ast__id_t(0, &v_34), _fx_catch_15);
      _fx_make_R17Ast__defvariant_t(&tname_0, type_params_0, v_33, &v_41, cases_1, 0, v_34, ifaces_0, 0, &loc_3, &v_35);
      FX_CALL(_fx_make_rR17Ast__defvariant_t(&v_35, &dvar_1), _fx_catch_15);
      FX_CALL(_fx_M3AstFM10DefVariantN10Ast__exp_t1rRM12defvariant_t(dvar_1, &v_36), _fx_catch_15);
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_10, v_36, fx_result);

   _fx_catch_15: ;
      if (v_36) {
         _fx_free_N10Ast__exp_t(&v_36);
      }
      if (dvar_1) {
         _fx_free_rR17Ast__defvariant_t(&dvar_1);
      }
      _fx_free_R17Ast__defvariant_t(&v_35);
      if (v_34) {
         _fx_free_rLR9Ast__id_t(&v_34);
      }
      if (v_33) {
         _fx_free_N10Ast__typ_t(&v_33);
      }
      if (cases_1) {
         _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&cases_1);
      }
      if (ts_10) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_10);
      }
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tN10Ast__typ_t(&v_32);
      if (ts_9) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_9);
      }
      goto _fx_endmatch_7;
   }
   fx_exn_t v_42 = {0};
   fx_exn_t v_43 = {0};
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t v_44 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_11 = 0;
   _fx_N10Ast__typ_t t_2 = 0;
   _fx_R13Ast__deftyp_t v_45 = {0};
   _fx_rR13Ast__deftyp_t dt_0 = 0;
   _fx_N10Ast__exp_t v_46 = 0;
   if (class_module_0 > 0) {
      _fx_R10Ast__loc_t loc_5;
      if (ts_5 != 0) {
         loc_5 = ts_5->hd.t1;
      }
      else {
         loc_5 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_16);
      fx_str_t slit_4 = FX_MAKE_STR("type alias (i.e. not a record nor variant) cannot be class");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_5, &slit_4, &v_42), _fx_catch_16);
      FX_THROW(&v_42, true, _fx_catch_16);
   }
   if (ifaces_0 != 0) {
      _fx_R10Ast__loc_t loc_6;
      if (ts_5 != 0) {
         loc_6 = ts_5->hd.t1;
      }
      else {
         loc_6 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_16);
      fx_str_t slit_5 = FX_MAKE_STR("type alias (i.e. not a record nor variant) cannot implement any interfaces");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_6, &slit_5, &v_43), _fx_catch_16);
      FX_THROW(&v_43, true, _fx_catch_16);
   }
   FX_CALL(
      _fx_M6ParserFM14parse_typespecT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_5,
         &v_44, 0), _fx_catch_16);
   FX_COPY_PTR(v_44.t0, &ts_11);
   FX_COPY_PTR(v_44.t1, &t_2);
   _fx_make_R13Ast__deftyp_t(&tname_0, type_params_0, t_2, false, 0, &loc_3, &v_45);
   FX_CALL(_fx_make_rR13Ast__deftyp_t(&v_45, &dt_0), _fx_catch_16);
   FX_CALL(_fx_M3AstFM6DefTypN10Ast__exp_t1rRM8deftyp_t(dt_0, &v_46), _fx_catch_16);
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_11, v_46, fx_result);

_fx_catch_16: ;
   if (v_46) {
      _fx_free_N10Ast__exp_t(&v_46);
   }
   if (dt_0) {
      _fx_free_rR13Ast__deftyp_t(&dt_0);
   }
   _fx_free_R13Ast__deftyp_t(&v_45);
   if (t_2) {
      _fx_free_N10Ast__typ_t(&t_2);
   }
   if (ts_11) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_11);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__typ_t(&v_44);
   fx_free_exn(&v_43);
   fx_free_exn(&v_42);

_fx_endmatch_7: ;

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_ti(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLR9Ast__id_t(&v_1);
   if (ts_2) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
   }
   FX_FREE_LIST_SIMPLE(&type_params_0);
   _fx_free_T3LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_tR10Ast__loc_t(&v_2);
   if (ts_3) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT2R9Ast__id_tLTa2R9Ast__id_t(&v_3);
   if (ts_4) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
   }
   if (ifaces_0) {
      _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(&ifaces_0);
   }
   if (ts_5) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM20parse_iface_members_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* members_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t result_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t members_1 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(members_0, &members_1);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t members_2 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(members_1, &members_2);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 21) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_0 = ts_2->tl;
            if (v_0 != 0) {
               _fx_LT2N14Lexer__token_tR10Ast__loc_t v_1 = v_0->tl;
               if (v_1 != 0) {
                  if (v_1->hd.t0.tag == 44) {
                     _fx_N14Lexer__token_t* v_2 = &v_0->hd.t0;
                     if (v_2->tag == 2) {
                        _fx_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB v_3 = {0};
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
                        _fx_LN10Ast__pat_t params_0 = 0;
                        _fx_N10Ast__typ_t rt_0 = 0;
                        _fx_LN10Ast__typ_t paramtyps_0 = 0;
                        _fx_N10Ast__typ_t v_4 = 0;
                        _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t v_5 = {0};
                        _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t v_6 = 0;
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t rest_0 = v_1->tl;
                        FX_CALL(
                           _fx_M6ParserFM16parse_fun_paramsT5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB1LT2N14Lexer__token_tR10Ast__loc_t(
                              rest_0, &v_3, 0), _fx_catch_2);
                        FX_COPY_PTR(v_3.t0, &ts_3);
                        FX_COPY_PTR(v_3.t1, &params_0);
                        FX_COPY_PTR(v_3.t2, &rt_0);
                        bool have_keywords_0 = v_3.t4;
                        _fx_LN10Ast__typ_t lstend_0 = 0;
                        _fx_LN10Ast__pat_t lst_0 = params_0;
                        for (; lst_0; lst_0 = lst_0->tl) {
                           _fx_N10Ast__typ_t res_0 = 0;
                           _fx_N10Ast__pat_t p_0 = lst_0->hd;
                           if (FX_REC_VARIANT_TAG(p_0) == 9) {
                              FX_COPY_PTR(p_0->u.PatTyped.t1, &res_0);
                           }
                           else {
                              fx_exn_t v_7 = {0};
                              _fx_R10Ast__loc_t loc_0;
                              if (rest_0 != 0) {
                                 loc_0 = rest_0->hd.t1;
                              }
                              else {
                                 loc_0 = _fx_g18Parser__parser_ctx.default_loc;
                              }
                              FX_CHECK_EXN(_fx_catch_0);
                              fx_str_t slit_0 =
                                 FX_MAKE_STR(
                                    "all parameters of interface methods should be identifiers with types (\'param: type\'); more complex patterns are not allowed");
                              FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_7), _fx_catch_0);
                              FX_THROW(&v_7, true, _fx_catch_0);

                           _fx_catch_0: ;
                              fx_free_exn(&v_7);
                           }
                           FX_CHECK_EXN(_fx_catch_1);
                           _fx_LN10Ast__typ_t node_0 = 0;
                           FX_CALL(_fx_cons_LN10Ast__typ_t(res_0, 0, false, &node_0), _fx_catch_1);
                           FX_LIST_APPEND(paramtyps_0, lstend_0, node_0);

                        _fx_catch_1: ;
                           if (res_0) {
                              _fx_free_N10Ast__typ_t(&res_0);
                           }
                           FX_CHECK_EXN(_fx_catch_2);
                        }
                        _fx_R16Ast__fun_flags_t v_8;
                        FX_CALL(_fx_M3AstFM17default_fun_flagsRM11fun_flags_t0(&v_8, 0), _fx_catch_2);
                        _fx_R16Ast__fun_flags_t fflags_0 =
                           { v_8.fun_flag_pure, v_8.fun_flag_ccode, have_keywords_0, v_8.fun_flag_inline, v_8.fun_flag_nothrow,
                              v_8.fun_flag_really_nothrow, v_8.fun_flag_private, v_8.fun_flag_ctor, v_8.fun_flag_method_of,
                              v_8.fun_flag_uses_fv, v_8.fun_flag_recursive, v_8.fun_flag_instance };
                        _fx_R9Ast__id_t v_9;
                        FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_2->u.IDENT.t1, &v_9, 0), _fx_catch_2);
                        FX_CALL(_fx_M3AstFM6TypFunN10Ast__typ_t2LN10Ast__typ_tN10Ast__typ_t(paramtyps_0, rt_0, &v_4),
                           _fx_catch_2);
                        _fx_make_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&v_9, v_4, &fflags_0, &v_5);
                        FX_CALL(_fx_cons_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&v_5, members_2, true, &v_6),
                           _fx_catch_2);
                        _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                        FX_COPY_PTR(ts_3, &ts_1);
                        _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&members_1);
                        FX_COPY_PTR(v_6, &members_1);

                     _fx_catch_2: ;
                        if (v_6) {
                           _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&v_6);
                        }
                        _fx_free_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&v_5);
                        if (v_4) {
                           _fx_free_N10Ast__typ_t(&v_4);
                        }
                        if (paramtyps_0) {
                           _fx_free_LN10Ast__typ_t(&paramtyps_0);
                        }
                        if (rt_0) {
                           _fx_free_N10Ast__typ_t(&rt_0);
                        }
                        if (params_0) {
                           _fx_free_LN10Ast__pat_t(&params_0);
                        }
                        if (ts_3) {
                           _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
                        }
                        _fx_free_T5LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__pat_tN10Ast__typ_tLN10Ast__exp_tB(&v_3);
                        goto _fx_endmatch_0;
                     }
                  }
               }
            }
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 50) {
            _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t __fold_result___0 = 0;
            _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t v_10 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t result_1 = {0};
            _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t lst_1 = members_2;
            for (; lst_1; lst_1 = lst_1->tl) {
               _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t r_0 = 0;
               _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* a_0 = &lst_1->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(a_0, r_0, false, &r_0), _fx_catch_3);
               _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_3: ;
               if (r_0) {
                  _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_4);
            }
            FX_COPY_PTR(__fold_result___0, &v_10);
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(ts_2->tl, v_10,
               &result_1);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&result_0);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&result_1, &result_0);
            FX_BREAK(_fx_catch_4);

         _fx_catch_4: ;
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&result_1);
            if (v_10) {
               _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&v_10);
            }
            if (__fold_result___0) {
               _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&__fold_result___0);
            }
            goto _fx_endmatch_0;
         }
      }
      fx_exn_t v_11 = {0};
      _fx_R10Ast__loc_t loc_1;
      if (ts_2 != 0) {
         loc_1 = ts_2->hd.t1;
      }
      else {
         loc_1 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_5);
      fx_str_t slit_1 = FX_MAKE_STR("expected \'fun <ident> (...\' or \'}\'");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_11), _fx_catch_5);
      FX_THROW(&v_11, true, _fx_catch_5);

   _fx_catch_5: ;
      fx_free_exn(&v_11);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_6);

   _fx_catch_6: ;
      if (members_2) {
         _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&members_2);
      }
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&result_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   if (members_1) {
      _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&members_1);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM11parse_ifaceT2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t v_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t v_2 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
   _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t members_0 = 0;
   _fx_R19Ast__definterface_t v_3 = {0};
   _fx_rR19Ast__definterface_t iface_0 = 0;
   _fx_N10Ast__exp_t v_4 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (ts_0 != 0) {
      _fx_N14Lexer__token_t* v_5 = &ts_0->hd.t0;
      if (v_5->tag == 2) {
         _fx_R9Ast__id_t v_6;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_5->u.IDENT.t1, &v_6, 0), _fx_catch_0);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(ts_0->tl, &v_6, &v_0);

      _fx_catch_0: ;
         goto _fx_endmatch_0;
      }
   }
   fx_exn_t v_7 = {0};
   _fx_R10Ast__loc_t loc_1;
   if (ts_0 != 0) {
      loc_1 = ts_0->hd.t1;
   }
   else {
      loc_1 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_1);
   fx_str_t slit_0 = FX_MAKE_STR("interface name (identifier) is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_0, &v_7), _fx_catch_1);
   FX_THROW(&v_7, true, _fx_catch_1);

_fx_catch_1: ;
   fx_free_exn(&v_7);

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   _fx_R9Ast__id_t iname_0 = v_0.t1;
   if (ts_1 != 0) {
      if (ts_1->hd.t0.tag == 54) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tS v_8 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
         fx_str_t base_iface_0 = {0};
         fx_str_t slit_1 = FX_MAKE_STR("");
         FX_CALL(
            _fx_M6ParserFM15parse_dot_identT2LT2N14Lexer__token_tR10Ast__loc_tS3LT2N14Lexer__token_tR10Ast__loc_tBS(ts_1->tl,
               false, &slit_1, &v_8, 0), _fx_catch_2);
         FX_COPY_PTR(v_8.t0, &ts_5);
         fx_copy_str(&v_8.t1, &base_iface_0);
         _fx_R9Ast__id_t v_9;
         FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&base_iface_0, &v_9, 0), _fx_catch_2);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(ts_5, &v_9, &v_1);

      _fx_catch_2: ;
         FX_FREE_STR(&base_iface_0);
         if (ts_5) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tS(&v_8);
         goto _fx_endmatch_1;
      }
   }
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(ts_1, &_fx_g9Ast__noid, &v_1);

_fx_endmatch_1: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_COPY_PTR(v_1.t0, &ts_2);
   _fx_R9Ast__id_t base_iface_1 = v_1.t1;
   if (ts_2 != 0) {
      if (ts_2->hd.t0.tag == 49) {
         FX_COPY_PTR(ts_2->tl, &ts_3); goto _fx_endmatch_2;
      }
   }
   fx_exn_t v_10 = {0};
   _fx_R10Ast__loc_t loc_2;
   if (ts_2 != 0) {
      loc_2 = ts_2->hd.t1;
   }
   else {
      loc_2 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_3);
   fx_str_t slit_2 = FX_MAKE_STR("\'{\' is expected");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_10), _fx_catch_3);
   FX_THROW(&v_10, true, _fx_catch_3);

_fx_catch_3: ;
   fx_free_exn(&v_10);

_fx_endmatch_2: ;
   FX_CHECK_EXN(_fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM20parse_iface_members_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
         ts_3, 0, &v_2, 0), _fx_cleanup);
   FX_COPY_PTR(v_2.t0, &ts_4);
   FX_COPY_PTR(v_2.t1, &members_0);
   _fx_make_R19Ast__definterface_t(&iname_0, &base_iface_1, members_0, 0, 0, loc_0, &v_3);
   FX_CALL(_fx_make_rR19Ast__definterface_t(&v_3, &iface_0), _fx_cleanup);
   FX_CALL(_fx_M3AstFM12DefInterfaceN10Ast__exp_t1rRM14definterface_t(iface_0, &v_4), _fx_cleanup);
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN10Ast__exp_t(ts_4, v_4, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tR9Ast__id_t(&v_1);
   if (ts_2) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
   }
   if (ts_3) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&v_2);
   if (ts_4) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
   }
   if (members_0) {
      _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&members_0);
   }
   _fx_free_R19Ast__definterface_t(&v_3);
   if (iface_0) {
      _fx_free_rR19Ast__definterface_t(&iface_0);
   }
   if (v_4) {
      _fx_free_N10Ast__exp_t(&v_4);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   fx_str_t* msg_0,
   fx_exn_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_R10Ast__loc_t loc_0;
   if (ts_0 != 0) {
      loc_0 = ts_0->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_cleanup);
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, msg_0, fx_result), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6ParserFM14pp_match_parenT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_tN14Lexer__token_tR10Ast__loc_t(
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* arg0_0,
   struct _fx_N14Lexer__token_t* ct_0,
   struct _fx_R10Ast__loc_t* ol_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv)
{
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_0 = 0;
   _fx_N15Parser__ppval_t x_0 = {0};
   int fx_status = 0;
   FX_COPY_PTR(arg0_0->t0, &ts_0);
   _fx_copy_N15Parser__ppval_t(&arg0_0->t1, &x_0);
   if (ts_0 != 0) {
      bool res_0;
      FX_CALL(_fx_M6ParserFM15__eq_variants__B2N14Lexer__token_tN14Lexer__token_t(&ts_0->hd.t0, ct_0, &res_0, 0), _fx_cleanup);
      if (res_0) {
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_0->tl, &x_0, fx_result); goto _fx_endmatch_0;
      }
   }
   _fx_Ta2S v_0 = {0};
   fx_str_t v_1 = {0};
   fx_str_t v_2 = {0};
   fx_str_t v_3 = {0};
   fx_exn_t v_4 = {0};
   FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(ct_0, &v_0, 0), _fx_catch_0);
   fx_copy_str(&v_0.t1, &v_1);
   FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(ol_0, &v_2, 0), _fx_catch_0);
   fx_str_t slit_0 = FX_MAKE_STR("\'");
   fx_str_t slit_1 = FX_MAKE_STR("\' is expected; the opening paren is here ");
   {
      const fx_str_t strs_0[] = { slit_0, v_1, slit_1, v_2 };
      FX_CALL(fx_strjoin(0, 0, 0, strs_0, 4, &v_3), _fx_catch_0);
   }
   _fx_R10Ast__loc_t loc_0;
   if (ts_0 != 0) {
      loc_0 = ts_0->hd.t1;
   }
   else {
      loc_0 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_0);
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &v_3, &v_4), _fx_catch_0);
   FX_THROW(&v_4, true, _fx_catch_0);

_fx_catch_0: ;
   fx_free_exn(&v_4);
   FX_FREE_STR(&v_3);
   FX_FREE_STR(&v_2);
   FX_FREE_STR(&v_1);
   _fx_free_Ta2S(&v_0);

_fx_endmatch_0: ;

_fx_cleanup: ;
   if (ts_0) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_0);
   }
   _fx_free_N15Parser__ppval_t(&x_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM11pp_get_boolB2N15Parser__ppval_tLT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_N15Parser__ppval_t* x_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (x_0->tag == 2) {
      *fx_result = x_0->u.PP_BOOL;
   }
   else {
      fx_exn_t v_0 = {0};
      _fx_R10Ast__loc_t loc_0;
      if (ts_0 != 0) {
         loc_0 = ts_0->hd.t1;
      }
      else {
         loc_0 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_0);
      fx_str_t slit_0 = FX_MAKE_STR("boolean value is expected here");
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_0), _fx_catch_0);
      FX_THROW(&v_0, true, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM10preprocessLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N15Parser__ppval_t v_0 = {0};
   _fx_Nt10Hashmap__t2SN15Parser__ppval_t env_arg_0 = 0;
   _fx_rNt10Hashmap__t2SN15Parser__ppval_t env_ref_0 = 0;
   int fx_status = 0;
   _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(0LL, &v_0);
   fx_str_t slit_0 = FX_MAKE_STR("");
   FX_CALL(_fx_M6ParserFM5emptyNt10Hashmap__t2SN15Parser__ppval_t3iSN15Parser__ppval_t(256, &slit_0, &v_0, &env_arg_0, 0),
      _fx_cleanup);
   FX_CALL(_fx_make_rNt10Hashmap__t2SN15Parser__ppval_t(env_arg_0, &env_ref_0), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM6ppnextLT2N14Lexer__token_tR10Ast__loc_t4LT2N14Lexer__token_tR10Ast__loc_tLT2N19Parser__ppifstate_tR10Ast__loc_tLT2N14Lexer__token_tR10Ast__loc_trNt10Hashmap__t2SN15Parser__ppval_t(
         ts_0, 0, 0, env_ref_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_N15Parser__ppval_t(&v_0);
   if (env_arg_0) {
      _fx_free_Nt10Hashmap__t2SN15Parser__ppval_t(&env_arg_0);
   }
   if (env_ref_0) {
      _fx_free_rNt10Hashmap__t2SN15Parser__ppval_t(&env_ref_0);
   }
   return fx_status;
}

static int
   _fx_M6ParserFM9pp_atomicT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv)
{
   _fx_N15Parser__ppval_t defval_0 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_Nt10Hashmap__t2SN15Parser__ppval_t* env_0 = &env_ref_0->data;
   _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B(false, &defval_0);
   if (ts_0 != 0) {
      _fx_N14Lexer__token_t* v_0 = &ts_0->hd.t0;
      if (v_0->tag == 2) {
         fx_str_t slit_0 = FX_MAKE_STR("defined");
         if (fx_streq(&v_0->u.IDENT.t1, &slit_0)) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_1 = ts_0->tl;
            if (v_1 != 0) {
               _fx_N14Lexer__token_t* v_2 = &v_1->hd.t0;
               if (v_2->tag == 44) {
                  if (v_2->u.LPAREN == false) {
                     _fx_LT2N14Lexer__token_tR10Ast__loc_t v_3 = v_1->tl;
                     if (v_3 != 0) {
                        _fx_LT2N14Lexer__token_tR10Ast__loc_t v_4 = v_3->tl;
                        if (v_4 != 0) {
                           if (v_4->hd.t0.tag == 46) {
                              _fx_N14Lexer__token_t* v_5 = &v_3->hd.t0;
                              if (v_5->tag == 2) {
                                 _fx_N15Parser__ppval_t v_6 = {0};
                                 if (calc_0) {
                                    _fx_Ta2i v_7;
                                    FX_CALL(
                                       _fx_M6ParserFM9find_idx_Ta2i2Nt10Hashmap__t2SN15Parser__ppval_tS(*env_0,
                                          &v_5->u.IDENT.t1, &v_7, 0), _fx_catch_0);
                                    _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B(v_7.t1 >= 0, &v_6);
                                 }
                                 else {
                                    _fx_copy_N15Parser__ppval_t(&defval_0, &v_6);
                                 }
                                 _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(v_4->tl, &v_6, fx_result);

                              _fx_catch_0: ;
                                 _fx_free_N15Parser__ppval_t(&v_6);
                                 goto _fx_endmatch_3;
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
   }
   if (ts_0 != 0) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_8 = ts_0->tl;
      if (v_8 != 0) {
         _fx_T2N14Lexer__token_tR10Ast__loc_t* v_9 = &v_8->hd;
         _fx_N14Lexer__token_t* v_10 = &v_9->t0;
         if (v_10->tag == 44) {
            if (v_10->u.LPAREN == false) {
               _fx_N14Lexer__token_t* v_11 = &ts_0->hd.t0;
               if (v_11->tag == 2) {
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_12 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
                  _fx_N15Parser__ppval_t x_0 = {0};
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_13 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
                  _fx_N15Parser__ppval_t x_1 = {0};
                  _fx_N15Parser__ppval_t x_2 = {0};
                  fx_str_t* fname_0 = &v_11->u.IDENT.t1;
                  FX_CALL(
                     _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                        v_8->tl, calc_0, env_ref_0, &v_12, 0), _fx_catch_5);
                  FX_COPY_PTR(v_12.t0, &ts_1);
                  _fx_copy_N15Parser__ppval_t(&v_12.t1, &x_0);
                  if (ts_1 != 0) {
                     bool res_0;
                     FX_CALL(
                        _fx_M6ParserFM15__eq_variants__B2N14Lexer__token_tN14Lexer__token_t(&ts_1->hd.t0,
                           &_fx_g14Parser__RPAREN, &res_0, 0), _fx_catch_5);
                     if (res_0) {
                        _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_1->tl, &x_0, &v_13);
                        goto _fx_endmatch_0;
                     }
                  }
                  _fx_Ta2S v_14 = {0};
                  fx_str_t v_15 = {0};
                  fx_str_t v_16 = {0};
                  fx_str_t v_17 = {0};
                  fx_exn_t v_18 = {0};
                  FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(&_fx_g14Parser__RPAREN, &v_14, 0), _fx_catch_1);
                  fx_copy_str(&v_14.t1, &v_15);
                  FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(&v_9->t1, &v_16, 0), _fx_catch_1);
                  fx_str_t slit_1 = FX_MAKE_STR("\'");
                  fx_str_t slit_2 = FX_MAKE_STR("\' is expected; the opening paren is here ");
                  {
                     const fx_str_t strs_0[] = { slit_1, v_15, slit_2, v_16 };
                     FX_CALL(fx_strjoin(0, 0, 0, strs_0, 4, &v_17), _fx_catch_1);
                  }
                  _fx_R10Ast__loc_t loc_0;
                  if (ts_1 != 0) {
                     loc_0 = ts_1->hd.t1;
                  }
                  else {
                     loc_0 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_1);
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &v_17, &v_18), _fx_catch_1);
                  FX_THROW(&v_18, true, _fx_catch_1);

               _fx_catch_1: ;
                  fx_free_exn(&v_18);
                  FX_FREE_STR(&v_17);
                  FX_FREE_STR(&v_16);
                  FX_FREE_STR(&v_15);
                  _fx_free_Ta2S(&v_14);

               _fx_endmatch_0: ;
                  FX_CHECK_EXN(_fx_catch_5);
                  FX_COPY_PTR(v_13.t0, &ts_2);
                  _fx_copy_N15Parser__ppval_t(&v_13.t1, &x_1);
                  if (calc_0) {
                     fx_str_t slit_3 = FX_MAKE_STR("int");
                     if (fx_streq(fname_0, &slit_3)) {
                        if (x_1.tag == 2) {
                           int64_t t_0;
                           if (x_1.u.PP_BOOL) {
                              t_0 = 1LL;
                           }
                           else {
                              t_0 = 0LL;
                           }
                           _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(t_0, &x_2);
                           goto _fx_endmatch_1;
                        }
                     }
                     fx_str_t slit_4 = FX_MAKE_STR("abs");
                     if (fx_streq(fname_0, &slit_4)) {
                        if (x_1.tag == 1) {
                           int64_t i_0 = x_1.u.PP_INT;
                           int64_t t_1;
                           if (i_0 >= 0LL) {
                              t_1 = i_0;
                           }
                           else {
                              t_1 = -i_0;
                           }
                           _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(t_1, &x_2);
                           goto _fx_endmatch_1;
                        }
                     }
                     fx_str_t slit_5 = FX_MAKE_STR("string");
                     if (fx_streq(fname_0, &slit_5)) {
                        if (x_1.tag == 2) {
                           fx_str_t v_19 = {0};
                           FX_CALL(_fx_F6stringS1B(x_1.u.PP_BOOL, &v_19, 0), _fx_catch_2);
                           _fx_M6ParserFM9PP_STRINGN15Parser__ppval_t1S(&v_19, &x_2);

                        _fx_catch_2: ;
                           FX_FREE_STR(&v_19);
                           goto _fx_endmatch_1;
                        }
                     }
                     fx_str_t slit_6 = FX_MAKE_STR("string");
                     if (fx_streq(fname_0, &slit_6)) {
                        if (x_1.tag == 1) {
                           fx_str_t v_20 = {0};
                           FX_CALL(_fx_F6stringS1l(x_1.u.PP_INT, &v_20, 0), _fx_catch_3);
                           _fx_M6ParserFM9PP_STRINGN15Parser__ppval_t1S(&v_20, &x_2);

                        _fx_catch_3: ;
                           FX_FREE_STR(&v_20);
                           goto _fx_endmatch_1;
                        }
                     }
                     fx_str_t v_21 = {0};
                     fx_exn_t v_22 = {0};
                     fx_str_t slit_7 = FX_MAKE_STR("unknown/unsupported function ");
                     {
                        const fx_str_t strs_1[] = { slit_7, *fname_0 };
                        FX_CALL(fx_strjoin(0, 0, 0, strs_1, 2, &v_21), _fx_catch_4);
                     }
                     _fx_R10Ast__loc_t loc_1;
                     if (ts_2 != 0) {
                        loc_1 = ts_2->hd.t1;
                     }
                     else {
                        loc_1 = _fx_g18Parser__parser_ctx.default_loc;
                     }
                     FX_CHECK_EXN(_fx_catch_4);
                     FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &v_21, &v_22), _fx_catch_4);
                     FX_THROW(&v_22, true, _fx_catch_4);

                  _fx_catch_4: ;
                     fx_free_exn(&v_22);
                     FX_FREE_STR(&v_21);

                  _fx_endmatch_1: ;
                     FX_CHECK_EXN(_fx_catch_5);
                  }
                  else {
                     _fx_copy_N15Parser__ppval_t(&defval_0, &x_2);
                  }
                  _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_2, &x_2, fx_result);

               _fx_catch_5: ;
                  _fx_free_N15Parser__ppval_t(&x_2);
                  _fx_free_N15Parser__ppval_t(&x_1);
                  if (ts_2) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_13);
                  _fx_free_N15Parser__ppval_t(&x_0);
                  if (ts_1) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_12);
                  goto _fx_endmatch_3;
               }
            }
         }
      }
   }
   if (ts_0 != 0) {
      _fx_N14Lexer__token_t* v_23 = &ts_0->hd.t0;
      if (v_23->tag == 2) {
         _fx_N15Parser__ppval_t x_3 = {0};
         _fx_Nt6option1N15Parser__ppval_t v_24 = {0};
         _fx_N15Parser__ppval_t v_25 = {0};
         fx_str_t* i_1 = &v_23->u.IDENT.t1;
         if (calc_0) {
            _fx_Ta2i v_26;
            FX_CALL(_fx_M6ParserFM9find_idx_Ta2i2Nt10Hashmap__t2SN15Parser__ppval_tS(*env_0, i_1, &v_26, 0), _fx_catch_7);
            int_ j_0 = v_26.t1;
            if (j_0 >= 0) {
               FX_CHKIDX(FX_CHKIDX1((*env_0)->u.t.t5, 0, j_0), _fx_catch_7);
               _fx_copy_N15Parser__ppval_t(
                  &FX_PTR_1D(_fx_Rt20Hashmap__hashentry_t2SN15Parser__ppval_t, (*env_0)->u.t.t5, j_0)->data, &v_25);
               _fx_M6ParserFM4SomeNt6option1N15Parser__ppval_t1N15Parser__ppval_t(&v_25, &v_24);
            }
            else {
               _fx_copy_Nt6option1N15Parser__ppval_t(&_fx_g12Parser__None, &v_24);
            }
            if (v_24.tag == 2) {
               _fx_copy_N15Parser__ppval_t(&v_24.u.Some, &x_3);
            }
            else {
               fx_str_t v_27 = {0};
               fx_exn_t v_28 = {0};
               fx_str_t slit_8 = FX_MAKE_STR("identifier \'");
               fx_str_t slit_9 = FX_MAKE_STR("\' is undefined");
               {
                  const fx_str_t strs_2[] = { slit_8, *i_1, slit_9 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_2, 3, &v_27), _fx_catch_6);
               }
               _fx_R10Ast__loc_t loc_2;
               if (ts_0 != 0) {
                  loc_2 = ts_0->hd.t1;
               }
               else {
                  loc_2 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_6);
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &v_27, &v_28), _fx_catch_6);
               FX_THROW(&v_28, true, _fx_catch_6);

            _fx_catch_6: ;
               fx_free_exn(&v_28);
               FX_FREE_STR(&v_27);
            }
            FX_CHECK_EXN(_fx_catch_7);
         }
         else {
            _fx_copy_N15Parser__ppval_t(&defval_0, &x_3);
         }
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_0->tl, &x_3, fx_result);

      _fx_catch_7: ;
         _fx_free_N15Parser__ppval_t(&v_25);
         _fx_free_Nt6option1N15Parser__ppval_t(&v_24);
         _fx_free_N15Parser__ppval_t(&x_3);
         goto _fx_endmatch_3;
      }
   }
   if (ts_0 != 0) {
      _fx_N14Lexer__token_t* v_29 = &ts_0->hd.t0;
      if (v_29->tag == 1) {
         _fx_N15Parser__ppval_t v_30 = {0};
         _fx_N10Ast__lit_t* lit_0 = &v_29->u.LITERAL;
         int tag_0 = lit_0->tag;
         if (tag_0 == 1) {
            _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(lit_0->u.LitInt, &v_30);
         }
         else if (tag_0 == 7) {
            _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B(lit_0->u.LitBool, &v_30);
         }
         else if (tag_0 == 5) {
            _fx_M6ParserFM9PP_STRINGN15Parser__ppval_t1S(&lit_0->u.LitString, &v_30);
         }
         else {
            fx_exn_t v_31 = {0};
            _fx_R10Ast__loc_t loc_3;
            if (ts_0 != 0) {
               loc_3 = ts_0->hd.t1;
            }
            else {
               loc_3 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_8);
            fx_str_t slit_10 =
               FX_MAKE_STR("preprocessor: unsupported literal (only integers, boolean values and strings are supported)");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_10, &v_31), _fx_catch_8);
            FX_THROW(&v_31, true, _fx_catch_8);

         _fx_catch_8: ;
            fx_free_exn(&v_31);
         }
         FX_CHECK_EXN(_fx_catch_9);
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_0->tl, &v_30, fx_result);

      _fx_catch_9: ;
         _fx_free_N15Parser__ppval_t(&v_30);
         goto _fx_endmatch_3;
      }
   }
   if (ts_0 != 0) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t* v_32 = &ts_0->hd;
      _fx_N14Lexer__token_t* v_33 = &v_32->t0;
      if (v_33->tag == 44) {
         fx_exn_t v_34 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_35 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N15Parser__ppval_t x_4 = {0};
         if (!v_33->u.LPAREN) {
            _fx_R10Ast__loc_t loc_4;
            if (ts_0 != 0) {
               loc_4 = ts_0->hd.t1;
            }
            else {
               loc_4 = _fx_g18Parser__parser_ctx.default_loc;
            }
            FX_CHECK_EXN(_fx_catch_11);
            fx_str_t slit_11 = FX_MAKE_STR("new line or \';\' is expected before new expression");
            FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_4, &slit_11, &v_34), _fx_catch_11);
            FX_THROW(&v_34, true, _fx_catch_11);
         }
         FX_CALL(
            _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
               ts_0->tl, calc_0, env_ref_0, &v_35, 0), _fx_catch_11);
         FX_COPY_PTR(v_35.t0, &ts_3);
         _fx_copy_N15Parser__ppval_t(&v_35.t1, &x_4);
         if (ts_3 != 0) {
            bool res_1;
            FX_CALL(
               _fx_M6ParserFM15__eq_variants__B2N14Lexer__token_tN14Lexer__token_t(&ts_3->hd.t0, &_fx_g14Parser__RPAREN, &res_1,
                  0), _fx_catch_11);
            if (res_1) {
               _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_3->tl, &x_4, fx_result); goto _fx_endmatch_2;
            }
         }
         _fx_Ta2S v_36 = {0};
         fx_str_t v_37 = {0};
         fx_str_t v_38 = {0};
         fx_str_t v_39 = {0};
         fx_exn_t v_40 = {0};
         FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(&_fx_g14Parser__RPAREN, &v_36, 0), _fx_catch_10);
         fx_copy_str(&v_36.t1, &v_37);
         FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(&v_32->t1, &v_38, 0), _fx_catch_10);
         fx_str_t slit_12 = FX_MAKE_STR("\'");
         fx_str_t slit_13 = FX_MAKE_STR("\' is expected; the opening paren is here ");
         {
            const fx_str_t strs_3[] = { slit_12, v_37, slit_13, v_38 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_3, 4, &v_39), _fx_catch_10);
         }
         _fx_R10Ast__loc_t loc_5;
         if (ts_3 != 0) {
            loc_5 = ts_3->hd.t1;
         }
         else {
            loc_5 = _fx_g18Parser__parser_ctx.default_loc;
         }
         FX_CHECK_EXN(_fx_catch_10);
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_5, &v_39, &v_40), _fx_catch_10);
         FX_THROW(&v_40, true, _fx_catch_10);

      _fx_catch_10: ;
         fx_free_exn(&v_40);
         FX_FREE_STR(&v_39);
         FX_FREE_STR(&v_38);
         FX_FREE_STR(&v_37);
         _fx_free_Ta2S(&v_36);

      _fx_endmatch_2: ;
         FX_CHECK_EXN(_fx_catch_11);

      _fx_catch_11: ;
         _fx_free_N15Parser__ppval_t(&x_4);
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_35);
         fx_free_exn(&v_34);
         goto _fx_endmatch_3;
      }
   }
   if (ts_0 != 0) {
      _fx_Ta2S v_41 = {0};
      fx_str_t v_42 = {0};
      fx_str_t v_43 = {0};
      fx_exn_t v_44 = {0};
      FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(&ts_0->hd.t0, &v_41, 0), _fx_catch_12);
      fx_copy_str(&v_41.t1, &v_42);
      fx_str_t slit_14 = FX_MAKE_STR("unxpected token \'");
      fx_str_t slit_15 = FX_MAKE_STR("\'. An identifier, literal or \'(\' is expected");
      {
         const fx_str_t strs_4[] = { slit_14, v_42, slit_15 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_4, 3, &v_43), _fx_catch_12);
      }
      _fx_R10Ast__loc_t loc_6;
      if (ts_0 != 0) {
         loc_6 = ts_0->hd.t1;
      }
      else {
         loc_6 = _fx_g18Parser__parser_ctx.default_loc;
      }
      FX_CHECK_EXN(_fx_catch_12);
      FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_6, &v_43, &v_44), _fx_catch_12);
      FX_THROW(&v_44, true, _fx_catch_12);

   _fx_catch_12: ;
      fx_free_exn(&v_44);
      FX_FREE_STR(&v_43);
      FX_FREE_STR(&v_42);
      _fx_free_Ta2S(&v_41);
      goto _fx_endmatch_3;
   }
   fx_exn_t v_45 = {0};
   _fx_R10Ast__loc_t loc_7;
   if (ts_0 != 0) {
      loc_7 = ts_0->hd.t1;
   }
   else {
      loc_7 = _fx_g18Parser__parser_ctx.default_loc;
   }
   FX_CHECK_EXN(_fx_catch_13);
   fx_str_t slit_16 = FX_MAKE_STR("premature end of the stream; check the parens");
   FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_7, &slit_16, &v_45), _fx_catch_13);
   FX_THROW(&v_45, true, _fx_catch_13);

_fx_catch_13: ;
   fx_free_exn(&v_45);

_fx_endmatch_3: ;

_fx_cleanup: ;
   _fx_free_N15Parser__ppval_t(&defval_0);
   return fx_status;
}

static int
   _fx_M6ParserFM8pp_unaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv)
{
   _fx_N15Parser__ppval_t defval_0 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B(false, &defval_0);
   if (ts_0 != 0) {
      _fx_N14Lexer__token_t* v_0 = &ts_0->hd.t0;
      if (v_0->tag == 64) {
         if (v_0->u.MINUS == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_1 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
            _fx_N15Parser__ppval_t x_0 = {0};
            _fx_N15Parser__ppval_t x_1 = {0};
            FX_CALL(
               _fx_M6ParserFM8pp_unaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                  ts_0->tl, calc_0, env_ref_0, &v_1, 0), _fx_catch_1);
            FX_COPY_PTR(v_1.t0, &ts_1);
            _fx_copy_N15Parser__ppval_t(&v_1.t1, &x_0);
            if (calc_0) {
               if (x_0.tag == 1) {
                  _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(-x_0.u.PP_INT, &x_1);
               }
               else {
                  fx_exn_t v_2 = {0};
                  _fx_R10Ast__loc_t loc_0;
                  if (ts_1 != 0) {
                     loc_0 = ts_1->hd.t1;
                  }
                  else {
                     loc_0 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_0);
                  fx_str_t slit_0 = FX_MAKE_STR("argument of unary \'-\' must be an integer");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_2), _fx_catch_0);
                  FX_THROW(&v_2, true, _fx_catch_0);

               _fx_catch_0: ;
                  fx_free_exn(&v_2);
               }
               FX_CHECK_EXN(_fx_catch_1);
            }
            else {
               _fx_copy_N15Parser__ppval_t(&defval_0, &x_1);
            }
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_1, &x_1, fx_result);

         _fx_catch_1: ;
            _fx_free_N15Parser__ppval_t(&x_1);
            _fx_free_N15Parser__ppval_t(&x_0);
            if (ts_1) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_1);
            goto _fx_endmatch_0;
         }
      }
   }
   if (ts_0 != 0) {
      _fx_N14Lexer__token_t* v_3 = &ts_0->hd.t0;
      if (v_3->tag == 65) {
         if (v_3->u.PLUS == true) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_4 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
            _fx_N15Parser__ppval_t x_2 = {0};
            _fx_N15Parser__ppval_t x_3 = {0};
            FX_CALL(
               _fx_M6ParserFM8pp_unaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                  ts_0->tl, calc_0, env_ref_0, &v_4, 0), _fx_catch_3);
            FX_COPY_PTR(v_4.t0, &ts_2);
            _fx_copy_N15Parser__ppval_t(&v_4.t1, &x_2);
            if (calc_0) {
               if (x_2.tag == 1) {
                  _fx_copy_N15Parser__ppval_t(&x_2, &x_3);
               }
               else {
                  fx_exn_t v_5 = {0};
                  _fx_R10Ast__loc_t loc_1;
                  if (ts_2 != 0) {
                     loc_1 = ts_2->hd.t1;
                  }
                  else {
                     loc_1 = _fx_g18Parser__parser_ctx.default_loc;
                  }
                  FX_CHECK_EXN(_fx_catch_2);
                  fx_str_t slit_1 = FX_MAKE_STR("argument of unary \'+\' must be an integer");
                  FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_5), _fx_catch_2);
                  FX_THROW(&v_5, true, _fx_catch_2);

               _fx_catch_2: ;
                  fx_free_exn(&v_5);
               }
               FX_CHECK_EXN(_fx_catch_3);
            }
            else {
               _fx_copy_N15Parser__ppval_t(&defval_0, &x_3);
            }
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_2, &x_3, fx_result);

         _fx_catch_3: ;
            _fx_free_N15Parser__ppval_t(&x_3);
            _fx_free_N15Parser__ppval_t(&x_2);
            if (ts_2) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_4);
            goto _fx_endmatch_0;
         }
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 82) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_6 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N15Parser__ppval_t x_4 = {0};
         _fx_N15Parser__ppval_t x_5 = {0};
         FX_CALL(
            _fx_M6ParserFM8pp_unaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
               ts_0->tl, calc_0, env_ref_0, &v_6, 0), _fx_catch_5);
         FX_COPY_PTR(v_6.t0, &ts_3);
         _fx_copy_N15Parser__ppval_t(&v_6.t1, &x_4);
         if (calc_0) {
            if (x_4.tag == 1) {
               _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(~x_4.u.PP_INT, &x_5);
            }
            else {
               fx_exn_t v_7 = {0};
               _fx_R10Ast__loc_t loc_2;
               if (ts_3 != 0) {
                  loc_2 = ts_3->hd.t1;
               }
               else {
                  loc_2 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_4);
               fx_str_t slit_2 = FX_MAKE_STR("argument of unary \'~\' must be an integer");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_7), _fx_catch_4);
               FX_THROW(&v_7, true, _fx_catch_4);

            _fx_catch_4: ;
               fx_free_exn(&v_7);
            }
            FX_CHECK_EXN(_fx_catch_5);
         }
         else {
            _fx_copy_N15Parser__ppval_t(&defval_0, &x_5);
         }
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_3, &x_5, fx_result);

      _fx_catch_5: ;
         _fx_free_N15Parser__ppval_t(&x_5);
         _fx_free_N15Parser__ppval_t(&x_4);
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_6);
         goto _fx_endmatch_0;
      }
   }
   if (ts_0 != 0) {
      if (ts_0->hd.t0.tag == 85) {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_8 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_N15Parser__ppval_t x_6 = {0};
         _fx_N15Parser__ppval_t x_7 = {0};
         FX_CALL(
            _fx_M6ParserFM8pp_unaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
               ts_0->tl, calc_0, env_ref_0, &v_8, 0), _fx_catch_7);
         FX_COPY_PTR(v_8.t0, &ts_4);
         _fx_copy_N15Parser__ppval_t(&v_8.t1, &x_6);
         if (calc_0) {
            if (x_6.tag == 2) {
               _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B(!x_6.u.PP_BOOL, &x_7);
            }
            else {
               fx_exn_t v_9 = {0};
               _fx_R10Ast__loc_t loc_3;
               if (ts_4 != 0) {
                  loc_3 = ts_4->hd.t1;
               }
               else {
                  loc_3 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_6);
               fx_str_t slit_3 = FX_MAKE_STR("argument of unary \'!\' must be a boolean");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_3, &v_9), _fx_catch_6);
               FX_THROW(&v_9, true, _fx_catch_6);

            _fx_catch_6: ;
               fx_free_exn(&v_9);
            }
            FX_CHECK_EXN(_fx_catch_7);
         }
         else {
            _fx_copy_N15Parser__ppval_t(&defval_0, &x_7);
         }
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_4, &x_7, fx_result);

      _fx_catch_7: ;
         _fx_free_N15Parser__ppval_t(&x_7);
         _fx_free_N15Parser__ppval_t(&x_6);
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_8);
         goto _fx_endmatch_0;
      }
   }
   FX_CALL(
      _fx_M6ParserFM9pp_atomicT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
         ts_0, calc_0, env_ref_0, fx_result, 0), _fx_catch_8);

_fx_catch_8: ;

_fx_endmatch_0: ;

_fx_cleanup: ;
   _fx_free_N15Parser__ppval_t(&defval_0);
   return fx_status;
}

static int
   _fx_M6ParserFM9pp_binaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N15Parser__ppval_t x_0 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM8pp_unaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
         ts_0, calc_0, env_ref_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   _fx_copy_N15Parser__ppval_t(&v_0.t1, &x_0);
   FX_CALL(
      _fx_M6ParserFM10pp_binary_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t5LT2N14Lexer__token_tR10Ast__loc_tBN15Parser__ppval_tirNt10Hashmap__t2SN15Parser__ppval_t(
         ts_1, calc_0, &x_0, 0, env_ref_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_N15Parser__ppval_t(&x_0);
   return fx_status;
}

static int
   _fx_M6ParserFM10pp_binary_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t5LT2N14Lexer__token_tR10Ast__loc_tBN15Parser__ppval_tirNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   struct _fx_N15Parser__ppval_t* result_0,
   int_ min_prec_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N15Parser__ppval_t result_2 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool calc_1 = calc_0;
   _fx_copy_N15Parser__ppval_t(result_0, &result_2);
   int_ min_prec_1 = min_prec_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_N15Parser__ppval_t result_3 = {0};
      FX_COPY_PTR(ts_1, &ts_2);
      bool calc_2 = calc_1;
      _fx_copy_N15Parser__ppval_t(&result_2, &result_3);
      int_ min_prec_2 = min_prec_1;
      if (ts_2 != 0) {
         _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t v_0 = {0};
         _fx_N13Ast__binary_t bop_0 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t result_4 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_1 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N15Parser__ppval_t x_0 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_2 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_N15Parser__ppval_t rhs_0 = {0};
         _fx_N15Parser__ppval_t result_5 = {0};
         _fx_N14Lexer__token_t* t_0 = &ts_2->hd.t0;
         int tag_0 = t_0->tag;
         if (tag_0 == 65) {
            if (t_0->u.PLUS == false) {
               _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpAdd, 210, &_fx_g17Parser__AssocLeft, &v_0);
               goto _fx_endmatch_0;
            }
         }
         if (tag_0 == 64) {
            if (t_0->u.MINUS == false) {
               _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpSub, 210, &_fx_g17Parser__AssocLeft, &v_0);
               goto _fx_endmatch_0;
            }
         }
         if (tag_0 == 66) {
            if (t_0->u.STAR == false) {
               _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpMul, 220, &_fx_g17Parser__AssocLeft, &v_0);
               goto _fx_endmatch_0;
            }
         }
         if (tag_0 == 67) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpDiv, 220, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 69) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpMod, 220, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 70) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpPow, 230, &_fx_g18Parser__AssocRight, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 78) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g19Parser__OpShiftLeft, 200, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 77) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g20Parser__OpShiftRight, 200, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 81) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g19Parser__OpBitwiseOr, 130, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 79) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g20Parser__OpBitwiseAnd, 150, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 80) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g20Parser__OpBitwiseXor, 140, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         if (tag_0 == 89) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g19Parser__OpSpaceship, 170, &_fx_g17Parser__AssocLeft, &v_0);
            goto _fx_endmatch_0;
         }
         _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpAdd, -1, &_fx_g17Parser__AssocLeft, &v_0);

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_7);
         FX_COPY_PTR(v_0.t0, &bop_0);
         int_ prec_0 = v_0.t1;
         _fx_N15Ast__op_assoc_t assoc_0 = v_0.t2;
         if (prec_0 < min_prec_2) {
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_2, &result_3, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_4, &result_1);
            FX_BREAK(_fx_catch_7);
         }
         else {
            int_ next_min_prec_0;
            if (assoc_0.tag == 1) {
               next_min_prec_0 = prec_0 + 1;
            }
            else {
               next_min_prec_0 = prec_0;
            }
            FX_CHECK_EXN(_fx_catch_7);
            FX_CALL(
               _fx_M6ParserFM8pp_unaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                  ts_2->tl, calc_2, env_ref_0, &v_1, 0), _fx_catch_7);
            FX_COPY_PTR(v_1.t0, &ts_3);
            _fx_copy_N15Parser__ppval_t(&v_1.t1, &x_0);
            FX_CALL(
               _fx_M6ParserFM10pp_binary_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t5LT2N14Lexer__token_tR10Ast__loc_tBN15Parser__ppval_tirNt10Hashmap__t2SN15Parser__ppval_t(
                  ts_3, calc_2, &x_0, next_min_prec_0, env_ref_0, &v_2, 0), _fx_catch_7);
            FX_COPY_PTR(v_2.t0, &ts_4);
            _fx_copy_N15Parser__ppval_t(&v_2.t1, &rhs_0);
            if (calc_2) {
               if (FX_REC_VARIANT_TAG(bop_0) == 1) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT + rhs_0.u.PP_INT, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 1) {
                  if (rhs_0.tag == 3) {
                     if (result_3.tag == 3) {
                        fx_str_t v_3 = {0};
                        fx_str_t* a_0 = &result_3.u.PP_STRING;
                        fx_str_t* b_0 = &rhs_0.u.PP_STRING;
                        {
                           const fx_str_t strs_0[] = { *a_0, *b_0 };
                           FX_CALL(fx_strjoin(0, 0, 0, strs_0, 2, &v_3), _fx_catch_0);
                        }
                        _fx_M6ParserFM9PP_STRINGN15Parser__ppval_t1S(&v_3, &result_5);

                     _fx_catch_0: ;
                        FX_FREE_STR(&v_3);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 2) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT - rhs_0.u.PP_INT, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 3) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT * rhs_0.u.PP_INT, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 4) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        fx_exn_t v_4 = {0};
                        int64_t b_1 = rhs_0.u.PP_INT;
                        if (b_1 == 0LL) {
                           _fx_R10Ast__loc_t loc_0;
                           if (ts_4 != 0) {
                              loc_0 = ts_4->hd.t1;
                           }
                           else {
                              loc_0 = _fx_g18Parser__parser_ctx.default_loc;
                           }
                           FX_CHECK_EXN(_fx_catch_1);
                           fx_str_t slit_0 = FX_MAKE_STR("division by zero");
                           FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_4), _fx_catch_1);
                           FX_THROW(&v_4, true, _fx_catch_1);
                        }
                        FX_CHECK_DIV_BY_ZERO(b_1, _fx_catch_1);
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT / b_1, &result_5);

                     _fx_catch_1: ;
                        fx_free_exn(&v_4);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 6) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        fx_exn_t v_5 = {0};
                        int64_t b_2 = rhs_0.u.PP_INT;
                        if (b_2 == 0LL) {
                           _fx_R10Ast__loc_t loc_1;
                           if (ts_4 != 0) {
                              loc_1 = ts_4->hd.t1;
                           }
                           else {
                              loc_1 = _fx_g18Parser__parser_ctx.default_loc;
                           }
                           FX_CHECK_EXN(_fx_catch_2);
                           fx_str_t slit_1 = FX_MAKE_STR("division by zero");
                           FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_5), _fx_catch_2);
                           FX_THROW(&v_5, true, _fx_catch_2);
                        }
                        FX_CHECK_DIV_BY_ZERO(b_2, _fx_catch_2);
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT % b_2, &result_5);

                     _fx_catch_2: ;
                        fx_free_exn(&v_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 7) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        fx_exn_t v_6 = {0};
                        int64_t b_3 = rhs_0.u.PP_INT;
                        if (b_3 < 0LL) {
                           _fx_R10Ast__loc_t loc_2;
                           if (ts_4 != 0) {
                              loc_2 = ts_4->hd.t1;
                           }
                           else {
                              loc_2 = _fx_g18Parser__parser_ctx.default_loc;
                           }
                           FX_CHECK_EXN(_fx_catch_3);
                           fx_str_t slit_2 = FX_MAKE_STR("negative power");
                           FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_2, &slit_2, &v_6), _fx_catch_3);
                           FX_THROW(&v_6, true, _fx_catch_3);
                        }
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l((int64_t)pow((double)result_3.u.PP_INT, (double)b_3),
                           &result_5);

                     _fx_catch_3: ;
                        fx_free_exn(&v_6);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 8) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT << rhs_0.u.PP_INT, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 9) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT >> rhs_0.u.PP_INT, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 18) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT | rhs_0.u.PP_INT, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 18) {
                  if (rhs_0.tag == 2) {
                     if (result_3.tag == 2) {
                        _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B((bool)(result_3.u.PP_BOOL | rhs_0.u.PP_BOOL), &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 20) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT ^ rhs_0.u.PP_INT, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 20) {
                  if (rhs_0.tag == 2) {
                     if (result_3.tag == 2) {
                        _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B(result_3.u.PP_BOOL ^ rhs_0.u.PP_BOOL, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 16) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l(result_3.u.PP_INT & rhs_0.u.PP_INT, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 16) {
                  if (rhs_0.tag == 2) {
                     if (result_3.tag == 2) {
                        _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B((bool)(result_3.u.PP_BOOL & rhs_0.u.PP_BOOL), &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 23) {
                  if (rhs_0.tag == 1) {
                     if (result_3.tag == 1) {
                        int_ res_0;
                        FX_CALL(_fx_F7__cmp__i2ll(result_3.u.PP_INT, rhs_0.u.PP_INT, &res_0, 0), _fx_catch_4);
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l((int64_t)res_0, &result_5);

                     _fx_catch_4: ;
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 23) {
                  if (rhs_0.tag == 2) {
                     if (result_3.tag == 2) {
                        int_ res_1;
                        FX_CALL(_fx_F7__cmp__i2BB(result_3.u.PP_BOOL, rhs_0.u.PP_BOOL, &res_1, 0), _fx_catch_5);
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l((int64_t)res_1, &result_5);

                     _fx_catch_5: ;
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 23) {
                  if (rhs_0.tag == 3) {
                     if (result_3.tag == 3) {
                        int_ v_7 = _fx_F7__cmp__i2SS(&result_3.u.PP_STRING, &rhs_0.u.PP_STRING, 0);
                        _fx_M6ParserFM6PP_INTN15Parser__ppval_t1l((int64_t)v_7, &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               fx_exn_t v_8 = {0};
               _fx_R10Ast__loc_t loc_3;
               if (ts_4 != 0) {
                  loc_3 = ts_4->hd.t1;
               }
               else {
                  loc_3 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_6);
               fx_str_t slit_3 = FX_MAKE_STR("unsupported binary operation");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_3, &slit_3, &v_8), _fx_catch_6);
               FX_THROW(&v_8, true, _fx_catch_6);

            _fx_catch_6: ;
               fx_free_exn(&v_8);

            _fx_endmatch_1: ;
               FX_CHECK_EXN(_fx_catch_7);
            }
            else {
               _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B(false, &result_5);
            }
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_4, &ts_1);
            calc_1 = calc_2;
            _fx_free_N15Parser__ppval_t(&result_2);
            _fx_copy_N15Parser__ppval_t(&result_5, &result_2);
            min_prec_1 = min_prec_2;
         }

      _fx_catch_7: ;
         _fx_free_N15Parser__ppval_t(&result_5);
         _fx_free_N15Parser__ppval_t(&rhs_0);
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_2);
         _fx_free_N15Parser__ppval_t(&x_0);
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_1);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_4);
         if (bop_0) {
            _fx_free_N13Ast__binary_t(&bop_0);
         }
         _fx_free_T3N13Ast__binary_tiN15Ast__op_assoc_t(&v_0);
      }
      else {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t result_6 = {0};
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_2, &result_3, &result_6);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_6, &result_1);
         FX_BREAK(_fx_catch_8);

      _fx_catch_8: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_6);
      }
      FX_CHECK_EXN(_fx_catch_9);

   _fx_catch_9: ;
      _fx_free_N15Parser__ppval_t(&result_3);
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_N15Parser__ppval_t(&result_2);
   return fx_status;
}

static int
   _fx_M6ParserFM13pp_extend_cmpT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t5LT2N14Lexer__token_tR10Ast__loc_tBBN15Parser__ppval_trNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   bool result_0,
   struct _fx_N15Parser__ppval_t* left_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N15Parser__ppval_t left_1 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool calc_1 = calc_0;
   bool result_2 = result_0;
   _fx_copy_N15Parser__ppval_t(left_0, &left_1);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_N15Parser__ppval_t left_2 = {0};
      FX_COPY_PTR(ts_1, &ts_2);
      bool calc_2 = calc_1;
      bool result_3 = result_2;
      _fx_copy_N15Parser__ppval_t(&left_1, &left_2);
      if (ts_2 != 0) {
         _fx_N14Lexer__token_t* v_0 = &ts_2->hd.t0;
         if (v_0->tag == 90) {
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_1 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
            _fx_N15Parser__ppval_t right_0 = {0};
            _fx_N12Ast__cmpop_t* cmpop_0 = &v_0->u.CMP;
            FX_CALL(
               _fx_M6ParserFM9pp_binaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                  ts_2->tl, calc_2, env_ref_0, &v_1, 0), _fx_catch_1);
            FX_COPY_PTR(v_1.t0, &ts_3);
            _fx_copy_N15Parser__ppval_t(&v_1.t1, &right_0);
            bool result_4;
            if (!calc_2) {
               result_4 = false;
            }
            else {
               bool v_2;
               if (cmpop_0->tag == 1) {
                  if (right_0.tag == 1) {
                     if (left_2.tag == 1) {
                        v_2 = left_2.u.PP_INT == right_0.u.PP_INT; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 1) {
                  if (right_0.tag == 2) {
                     if (left_2.tag == 2) {
                        v_2 = left_2.u.PP_BOOL == right_0.u.PP_BOOL; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 1) {
                  if (right_0.tag == 3) {
                     if (left_2.tag == 3) {
                        v_2 = _fx_F6__eq__B2SS(&left_2.u.PP_STRING, &right_0.u.PP_STRING, 0); goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 2) {
                  if (right_0.tag == 1) {
                     if (left_2.tag == 1) {
                        v_2 = left_2.u.PP_INT != right_0.u.PP_INT; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 2) {
                  if (right_0.tag == 2) {
                     if (left_2.tag == 2) {
                        v_2 = left_2.u.PP_BOOL != right_0.u.PP_BOOL; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 2) {
                  if (right_0.tag == 3) {
                     if (left_2.tag == 3) {
                        bool v_3 = _fx_F6__eq__B2SS(&left_2.u.PP_STRING, &right_0.u.PP_STRING, 0);
                        v_2 = !v_3;
                        goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 3) {
                  if (right_0.tag == 1) {
                     if (left_2.tag == 1) {
                        v_2 = left_2.u.PP_INT < right_0.u.PP_INT; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 3) {
                  if (right_0.tag == 2) {
                     if (left_2.tag == 2) {
                        v_2 = left_2.u.PP_BOOL < right_0.u.PP_BOOL; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 3) {
                  if (right_0.tag == 3) {
                     if (left_2.tag == 3) {
                        int_ v_4 = _fx_F7__cmp__i2SS(&left_2.u.PP_STRING, &right_0.u.PP_STRING, 0);
                        v_2 = v_4 < 0;
                        goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 4) {
                  if (right_0.tag == 1) {
                     if (left_2.tag == 1) {
                        v_2 = left_2.u.PP_INT <= right_0.u.PP_INT; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 4) {
                  if (right_0.tag == 2) {
                     if (left_2.tag == 2) {
                        v_2 = left_2.u.PP_BOOL <= right_0.u.PP_BOOL; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 4) {
                  if (right_0.tag == 3) {
                     if (left_2.tag == 3) {
                        int_ v_5 = _fx_F7__cmp__i2SS(&left_2.u.PP_STRING, &right_0.u.PP_STRING, 0);
                        v_2 = v_5 <= 0;
                        goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 5) {
                  if (right_0.tag == 1) {
                     if (left_2.tag == 1) {
                        v_2 = left_2.u.PP_INT >= right_0.u.PP_INT; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 5) {
                  if (right_0.tag == 2) {
                     if (left_2.tag == 2) {
                        v_2 = left_2.u.PP_BOOL >= right_0.u.PP_BOOL; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 5) {
                  if (right_0.tag == 3) {
                     if (left_2.tag == 3) {
                        int_ v_6 = _fx_F7__cmp__i2SS(&left_2.u.PP_STRING, &right_0.u.PP_STRING, 0);
                        v_2 = v_6 >= 0;
                        goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 6) {
                  if (right_0.tag == 1) {
                     if (left_2.tag == 1) {
                        v_2 = left_2.u.PP_INT > right_0.u.PP_INT; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 6) {
                  if (right_0.tag == 2) {
                     if (left_2.tag == 2) {
                        v_2 = left_2.u.PP_BOOL > right_0.u.PP_BOOL; goto _fx_endmatch_0;
                     }
                  }
               }
               if (cmpop_0->tag == 6) {
                  if (right_0.tag == 3) {
                     if (left_2.tag == 3) {
                        int_ v_7 = _fx_F7__cmp__i2SS(&left_2.u.PP_STRING, &right_0.u.PP_STRING, 0);
                        v_2 = v_7 > 0;
                        goto _fx_endmatch_0;
                     }
                  }
               }
               fx_exn_t v_8 = {0};
               _fx_R10Ast__loc_t loc_0;
               if (ts_3 != 0) {
                  loc_0 = ts_3->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("unsupported comparison operation");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_8), _fx_catch_0);
               FX_THROW(&v_8, true, _fx_catch_0);

            _fx_catch_0: ;
               fx_free_exn(&v_8);

            _fx_endmatch_0: ;
               FX_CHECK_EXN(_fx_catch_1);
               result_4 = (bool)(result_3 & v_2);
            }
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_3, &ts_1);
            calc_1 = calc_2;
            result_2 = result_4;
            _fx_free_N15Parser__ppval_t(&left_1);
            _fx_copy_N15Parser__ppval_t(&right_0, &left_1);

         _fx_catch_1: ;
            _fx_free_N15Parser__ppval_t(&right_0);
            if (ts_3) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_1);
            goto _fx_endmatch_1;
         }
      }
      _fx_N15Parser__ppval_t v_9 = {0};
      _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t result_5 = {0};
      _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B(result_3, &v_9);
      _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_2, &v_9, &result_5);
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1);
      _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_5, &result_1);
      FX_BREAK(_fx_catch_2);

   _fx_catch_2: ;
      _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_5);
      _fx_free_N15Parser__ppval_t(&v_9);

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_3);

   _fx_catch_3: ;
      _fx_free_N15Parser__ppval_t(&left_2);
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_N15Parser__ppval_t(&left_1);
   return fx_status;
}

static int
   _fx_M6ParserFM14pp_chained_cmpT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N15Parser__ppval_t x_0 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM9pp_binaryT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
         ts_0, calc_0, env_ref_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   _fx_copy_N15Parser__ppval_t(&v_0.t1, &x_0);
   if (ts_1 != 0) {
      if (ts_1->hd.t0.tag == 90) {
         FX_CALL(
            _fx_M6ParserFM13pp_extend_cmpT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t5LT2N14Lexer__token_tR10Ast__loc_tBBN15Parser__ppval_trNt10Hashmap__t2SN15Parser__ppval_t(
               ts_1, calc_0, true, &x_0, env_ref_0, fx_result, 0), _fx_catch_0);

      _fx_catch_0: ;
         goto _fx_endmatch_0;
      }
   }
   _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_1, &x_0, fx_result);

_fx_endmatch_0: ;

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_N15Parser__ppval_t(&x_0);
   return fx_status;
}

static int
   _fx_M6ParserFM8pp_logicT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t5LT2N14Lexer__token_tR10Ast__loc_tBN15Parser__ppval_tirNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   struct _fx_N15Parser__ppval_t* result_0,
   int_ min_prec_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t result_1 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N15Parser__ppval_t result_2 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(ts_0, &ts_1);
   bool calc_1 = calc_0;
   _fx_copy_N15Parser__ppval_t(result_0, &result_2);
   int_ min_prec_1 = min_prec_0;
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_N15Parser__ppval_t result_3 = {0};
      FX_COPY_PTR(ts_1, &ts_2);
      bool calc_2 = calc_1;
      _fx_copy_N15Parser__ppval_t(&result_2, &result_3);
      int_ min_prec_2 = min_prec_1;
      if (ts_2 != 0) {
         _fx_T3N13Ast__binary_tiN15Ast__op_assoc_t v_0 = {0};
         _fx_N13Ast__binary_t bop_0 = 0;
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t result_4 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_1 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
         _fx_N15Parser__ppval_t x_0 = {0};
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_2 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
         _fx_N15Parser__ppval_t rhs_0 = {0};
         _fx_N15Parser__ppval_t result_5 = {0};
         int tag_0 = ts_2->hd.t0.tag;
         if (tag_0 == 84) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g17Parser__OpLogicOr, 10, &_fx_g17Parser__AssocLeft, &v_0);
         }
         else if (tag_0 == 83) {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g18Parser__OpLogicAnd, 20, &_fx_g17Parser__AssocLeft, &v_0);
         }
         else {
            _fx_make_T3N13Ast__binary_tiN15Ast__op_assoc_t(_fx_g13Parser__OpAdd, -1, &_fx_g17Parser__AssocLeft, &v_0);
         }
         FX_CHECK_EXN(_fx_catch_2);
         FX_COPY_PTR(v_0.t0, &bop_0);
         int_ prec_0 = v_0.t1;
         _fx_N15Ast__op_assoc_t assoc_0 = v_0.t2;
         if (prec_0 < min_prec_2) {
            _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_2, &result_3, &result_4);
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1);
            _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_4, &result_1);
            FX_BREAK(_fx_catch_2);
         }
         else {
            if (result_3.tag != 2) {
               fx_exn_t v_3 = {0};
               _fx_R10Ast__loc_t loc_0;
               if (ts_2 != 0) {
                  loc_0 = ts_2->hd.t1;
               }
               else {
                  loc_0 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_0);
               fx_str_t slit_0 = FX_MAKE_STR("arguments of || and && operations must be booleans");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_0, &slit_0, &v_3), _fx_catch_0);
               FX_THROW(&v_3, true, _fx_catch_0);

            _fx_catch_0: ;
               fx_free_exn(&v_3);
            }
            FX_CHECK_EXN(_fx_catch_2);
            int_ next_min_prec_0;
            if (assoc_0.tag == 1) {
               next_min_prec_0 = prec_0 + 1;
            }
            else {
               next_min_prec_0 = prec_0;
            }
            FX_CHECK_EXN(_fx_catch_2);
            FX_CALL(
               _fx_M6ParserFM14pp_chained_cmpT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                  ts_2->tl, calc_2, env_ref_0, &v_1, 0), _fx_catch_2);
            FX_COPY_PTR(v_1.t0, &ts_3);
            _fx_copy_N15Parser__ppval_t(&v_1.t1, &x_0);
            bool calc_rhs_0;
            if (FX_REC_VARIANT_TAG(bop_0) == 19) {
               if (result_3.tag == 2) {
                  if (result_3.u.PP_BOOL == true) {
                     calc_rhs_0 = false; goto _fx_endmatch_0;
                  }
               }
            }
            if (FX_REC_VARIANT_TAG(bop_0) == 17) {
               if (result_3.tag == 2) {
                  if (result_3.u.PP_BOOL == false) {
                     calc_rhs_0 = false; goto _fx_endmatch_0;
                  }
               }
            }
            calc_rhs_0 = calc_2;

         _fx_endmatch_0: ;
            FX_CHECK_EXN(_fx_catch_2);
            FX_CALL(
               _fx_M6ParserFM8pp_logicT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t5LT2N14Lexer__token_tR10Ast__loc_tBN15Parser__ppval_tirNt10Hashmap__t2SN15Parser__ppval_t(
                  ts_3, calc_rhs_0, &x_0, next_min_prec_0, env_ref_0, &v_2, 0), _fx_catch_2);
            FX_COPY_PTR(v_2.t0, &ts_4);
            _fx_copy_N15Parser__ppval_t(&v_2.t1, &rhs_0);
            if (calc_rhs_0) {
               if (FX_REC_VARIANT_TAG(bop_0) == 19) {
                  if (rhs_0.tag == 2) {
                     if (result_3.tag == 2) {
                        _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B((bool)(result_3.u.PP_BOOL | rhs_0.u.PP_BOOL), &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               if (FX_REC_VARIANT_TAG(bop_0) == 17) {
                  if (rhs_0.tag == 2) {
                     if (result_3.tag == 2) {
                        _fx_M6ParserFM7PP_BOOLN15Parser__ppval_t1B((bool)(result_3.u.PP_BOOL & rhs_0.u.PP_BOOL), &result_5);
                        goto _fx_endmatch_1;
                     }
                  }
               }
               fx_exn_t v_4 = {0};
               _fx_R10Ast__loc_t loc_1;
               if (ts_4 != 0) {
                  loc_1 = ts_4->hd.t1;
               }
               else {
                  loc_1 = _fx_g18Parser__parser_ctx.default_loc;
               }
               FX_CHECK_EXN(_fx_catch_1);
               fx_str_t slit_1 = FX_MAKE_STR("arguments of || and && operations must be booleans");
               FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&loc_1, &slit_1, &v_4), _fx_catch_1);
               FX_THROW(&v_4, true, _fx_catch_1);

            _fx_catch_1: ;
               fx_free_exn(&v_4);

            _fx_endmatch_1: ;
               FX_CHECK_EXN(_fx_catch_2);
            }
            else {
               _fx_copy_N15Parser__ppval_t(&result_3, &result_5);
            }
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_4, &ts_1);
            calc_1 = calc_2;
            _fx_free_N15Parser__ppval_t(&result_2);
            _fx_copy_N15Parser__ppval_t(&result_5, &result_2);
            min_prec_1 = min_prec_2;
         }

      _fx_catch_2: ;
         _fx_free_N15Parser__ppval_t(&result_5);
         _fx_free_N15Parser__ppval_t(&rhs_0);
         if (ts_4) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_2);
         _fx_free_N15Parser__ppval_t(&x_0);
         if (ts_3) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
         }
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_1);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_4);
         if (bop_0) {
            _fx_free_N13Ast__binary_t(&bop_0);
         }
         _fx_free_T3N13Ast__binary_tiN15Ast__op_assoc_t(&v_0);
      }
      else {
         _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t result_6 = {0};
         _fx_make_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(ts_2, &result_3, &result_6);
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1);
         _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_6, &result_1);
         FX_BREAK(_fx_catch_3);

      _fx_catch_3: ;
         _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_6);
      }
      FX_CHECK_EXN(_fx_catch_4);

   _fx_catch_4: ;
      _fx_free_N15Parser__ppval_t(&result_3);
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&result_1);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_N15Parser__ppval_t(&result_2);
   return fx_status;
}

static int
   _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   bool calc_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t* fx_result,
   void* fx_fv)
{
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_N15Parser__ppval_t x_0 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6ParserFM14pp_chained_cmpT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
         ts_0, calc_0, env_ref_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, &ts_1);
   _fx_copy_N15Parser__ppval_t(&v_0.t1, &x_0);
   FX_CALL(
      _fx_M6ParserFM8pp_logicT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t5LT2N14Lexer__token_tR10Ast__loc_tBN15Parser__ppval_tirNt10Hashmap__t2SN15Parser__ppval_t(
         ts_1, calc_0, &x_0, 0, env_ref_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_0);
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   _fx_free_N15Parser__ppval_t(&x_0);
   return fx_status;
}

static int
   _fx_M6ParserFM6ppnextLT2N14Lexer__token_tR10Ast__loc_t4LT2N14Lexer__token_tR10Ast__loc_tLT2N19Parser__ppifstate_tR10Ast__loc_tLT2N14Lexer__token_tR10Ast__loc_trNt10Hashmap__t2SN15Parser__ppval_t(
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* ts_0,
   struct _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t_data_t* ppstack_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t* result_0,
   struct _fx_rNt10Hashmap__t2SN15Parser__ppval_t_data_t* env_ref_0,
   struct _fx_LT2N14Lexer__token_tR10Ast__loc_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LT2N14Lexer__token_tR10Ast__loc_t result_1 = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_1 = 0;
   _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t ppstack_1 = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t result_2 = 0;
   int fx_status = 0;
   _fx_Nt10Hashmap__t2SN15Parser__ppval_t* env_0 = &env_ref_0->data;
   FX_COPY_PTR(ts_0, &ts_1);
   FX_COPY_PTR(ppstack_0, &ppstack_1);
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_2 = 0;
      _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t ppstack_2 = 0;
      _fx_LT2N14Lexer__token_tR10Ast__loc_t result_3 = 0;
      FX_COPY_PTR(ts_1, &ts_2);
      FX_COPY_PTR(ppstack_1, &ppstack_2);
      FX_COPY_PTR(result_2, &result_3);
      bool process_0;
      bool res_0;
      if (ppstack_2 != 0) {
         if (ppstack_2->hd.t0.tag == 2) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (ppstack_2 != 0) {
         _fx_N19Parser__ppifstate_t* v_0 = &ppstack_2->hd.t0;
         if (v_0->tag == 3) {
            if (v_0->u.PP_BR_ELSE == false) {
               res_0 = true; goto _fx_endmatch_0;
            }
         }
      }
      res_0 = false;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_24);
      if (res_0) {
         process_0 = false; goto _fx_endmatch_1;
      }
      process_0 = true;

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_24);
      bool parent_process_0;
      bool res_1;
      if (ppstack_2 != 0) {
         _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t v_1 = ppstack_2->tl;
         if (v_1 != 0) {
            if (v_1->hd.t0.tag == 2) {
               res_1 = true; goto _fx_endmatch_2;
            }
         }
      }
      if (ppstack_2 != 0) {
         _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t v_2 = ppstack_2->tl;
         if (v_2 != 0) {
            _fx_N19Parser__ppifstate_t* v_3 = &v_2->hd.t0;
            if (v_3->tag == 3) {
               if (v_3->u.PP_BR_ELSE == false) {
                  res_1 = true; goto _fx_endmatch_2;
               }
            }
         }
      }
      res_1 = false;

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_24);
      if (res_1) {
         parent_process_0 = false; goto _fx_endmatch_3;
      }
      parent_process_0 = true;

   _fx_endmatch_3: ;
      FX_CHECK_EXN(_fx_catch_24);
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 101) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t rest_0 = ts_2->tl;
            if (rest_0 != 0) {
               _fx_N14Lexer__token_t* v_4 = &rest_0->hd.t0;
               if (v_4->tag == 2) {
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_5 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_3 = 0;
                  _fx_N15Parser__ppval_t x_0 = {0};
                  fx_str_t v_6 = {0};
                  fx_str_t v_7 = {0};
                  fx_exn_t v_8 = {0};
                  fx_str_t* n_0 = &v_4->u.IDENT.t1;
                  FX_CALL(
                     _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                        rest_0->tl, process_0, env_ref_0, &v_5, 0), _fx_catch_0);
                  FX_COPY_PTR(v_5.t0, &ts_3);
                  _fx_copy_N15Parser__ppval_t(&v_5.t1, &x_0);
                  if (process_0) {
                     bool v_9;
                     FX_CALL(_fx_M6ParserFM3memB2Nt10Hashmap__t2SN15Parser__ppval_tS(*env_0, n_0, &v_9, 0), _fx_catch_0);
                     if (v_9) {
                        FX_CALL(_fx_M6ParserFM6stringS1S(n_0, &v_6, 0), _fx_catch_0);
                        fx_str_t slit_0 = FX_MAKE_STR("symbol \'");
                        fx_str_t slit_1 = FX_MAKE_STR("\' is already defined");
                        {
                           const fx_str_t strs_0[] = { slit_0, v_6, slit_1 };
                           FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_7), _fx_catch_0);
                        }
                        FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_3, &v_7, &v_8, 0), _fx_catch_0);
                        FX_THROW(&v_8, true, _fx_catch_0);
                     }
                     FX_CALL(_fx_M6ParserFM3addv3Nt10Hashmap__t2SN15Parser__ppval_tSN15Parser__ppval_t(*env_0, n_0, &x_0, 0),
                        _fx_catch_0);
                  }
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  FX_COPY_PTR(ts_3, &ts_1);
                  FX_FREE_LIST_SIMPLE(&ppstack_1);
                  FX_COPY_PTR(ppstack_2, &ppstack_1);
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
                  FX_COPY_PTR(result_3, &result_2);

               _fx_catch_0: ;
                  fx_free_exn(&v_8);
                  FX_FREE_STR(&v_7);
                  FX_FREE_STR(&v_6);
                  _fx_free_N15Parser__ppval_t(&x_0);
                  if (ts_3) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_3);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_5);
                  goto _fx_endmatch_4;
               }
            }
            fx_exn_t v_10 = {0};
            fx_str_t slit_2 =
               FX_MAKE_STR("invalid syntax of the new preprocessor symbol definition. It should be \'@DEFINE name expr\'");
            FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &slit_2, &v_10, 0), _fx_catch_1);
            FX_THROW(&v_10, true, _fx_catch_1);

         _fx_catch_1: ;
            fx_free_exn(&v_10);

         _fx_endmatch_4: ;
            FX_CHECK_EXN(_fx_catch_2);

         _fx_catch_2: ;
            goto _fx_endmatch_11;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 102) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t rest_1 = ts_2->tl;
            if (rest_1 != 0) {
               _fx_N14Lexer__token_t* v_11 = &rest_1->hd.t0;
               if (v_11->tag == 2) {
                  if (process_0) {
                     FX_CALL(_fx_M6ParserFM6removev2Nt10Hashmap__t2SN15Parser__ppval_tS(*env_0, &v_11->u.IDENT.t1, 0),
                        _fx_catch_3);
                  }
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_2 = &rest_1->tl;
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  FX_COPY_PTR(*rest_2, &ts_1);
                  FX_FREE_LIST_SIMPLE(&ppstack_1);
                  FX_COPY_PTR(ppstack_2, &ppstack_1);
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
                  FX_COPY_PTR(result_3, &result_2);

               _fx_catch_3: ;
                  goto _fx_endmatch_5;
               }
            }
            FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_4);

         _fx_endmatch_5: ;
            FX_CHECK_EXN(_fx_catch_4);

         _fx_catch_4: ;
            goto _fx_endmatch_11;
         }
      }
      bool res_2;
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 96) {
            res_2 = true; goto _fx_endmatch_6;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 97) {
            res_2 = true; goto _fx_endmatch_6;
         }
      }
      res_2 = false;

   _fx_endmatch_6: ;
      FX_CHECK_EXN(_fx_catch_24);
      if (res_2) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_12 = 0;
         bool negate_0;
         if (ts_2 != 0) {
            if (ts_2->hd.t0.tag == 97) {
               negate_0 = true; goto _fx_endmatch_7;
            }
         }
         negate_0 = false;

      _fx_endmatch_7: ;
         FX_CHECK_EXN(_fx_catch_7);
         FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_12, 0),
            _fx_catch_7);
         if (v_12 != 0) {
            _fx_N14Lexer__token_t* v_13 = &v_12->hd.t0;
            if (v_13->tag == 2) {
               _fx_T2N14Lexer__token_tR10Ast__loc_t v_14 = {0};
               _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t v_15 = 0;
               _fx_N19Parser__ppifstate_t state_0;
               if (!process_0) {
                  _fx_M6ParserFM11PP_BR_FALSEN19Parser__ppifstate_t1B(true, &state_0);
               }
               else {
                  bool v_16;
                  FX_CALL(_fx_M6ParserFM3memB2Nt10Hashmap__t2SN15Parser__ppval_tS(*env_0, &v_13->u.IDENT.t1, &v_16, 0),
                     _fx_catch_5);
                  if (v_16 ^ negate_0) {
                     state_0 = _fx_g18Parser__PP_BR_TRUE;
                  }
                  else {
                     _fx_M6ParserFM11PP_BR_FALSEN19Parser__ppifstate_t1B(false, &state_0);
                  }
               }
               FX_CALL(_fx_M6ParserFM2hdT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_14, 0),
                  _fx_catch_5);
               _fx_R10Ast__loc_t v_17 = v_14.t1;
               _fx_T2N19Parser__ppifstate_tR10Ast__loc_t v_18 = { state_0, v_17 };
               FX_CALL(_fx_cons_LT2N19Parser__ppifstate_tR10Ast__loc_t(&v_18, ppstack_2, true, &v_15), _fx_catch_5);
               _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_3 = &v_12->tl;
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
               FX_COPY_PTR(*rest_3, &ts_1);
               FX_FREE_LIST_SIMPLE(&ppstack_1);
               FX_COPY_PTR(v_15, &ppstack_1);
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
               FX_COPY_PTR(result_3, &result_2);

            _fx_catch_5: ;
               FX_FREE_LIST_SIMPLE(&v_15);
               _fx_free_T2N14Lexer__token_tR10Ast__loc_t(&v_14);
               goto _fx_endmatch_8;
            }
         }
         fx_exn_t v_19 = {0};
         fx_str_t slit_3 = FX_MAKE_STR("invalid @IFDEF/@IFNDEF syntax: It should be \'@IF[N]DEF name\'");
         FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &slit_3, &v_19, 0), _fx_catch_6);
         FX_THROW(&v_19, true, _fx_catch_6);

      _fx_catch_6: ;
         fx_free_exn(&v_19);

      _fx_endmatch_8: ;
         FX_CHECK_EXN(_fx_catch_7);

      _fx_catch_7: ;
         if (v_12) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_12);
         }
         goto _fx_endmatch_11;
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 95) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_20 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_21 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_4 = 0;
            _fx_N15Parser__ppval_t x_1 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_22 = 0;
            _fx_T2N14Lexer__token_tR10Ast__loc_t v_23 = {0};
            _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t v_24 = 0;
            FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_20, 0),
               _fx_catch_8);
            FX_CALL(
               _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                  v_20, process_0, env_ref_0, &v_21, 0), _fx_catch_8);
            FX_COPY_PTR(v_21.t0, &ts_4);
            _fx_copy_N15Parser__ppval_t(&v_21.t1, &x_1);
            _fx_N19Parser__ppifstate_t state_1;
            if (!process_0) {
               _fx_M6ParserFM11PP_BR_FALSEN19Parser__ppifstate_t1B(true, &state_1);
            }
            else {
               FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_4, &v_22, 0),
                  _fx_catch_8);
               bool v_25;
               FX_CALL(_fx_M6ParserFM11pp_get_boolB2N15Parser__ppval_tLT2N14Lexer__token_tR10Ast__loc_t(&x_1, v_22, &v_25, 0),
                  _fx_catch_8);
               if (v_25) {
                  state_1 = _fx_g18Parser__PP_BR_TRUE;
               }
               else {
                  _fx_M6ParserFM11PP_BR_FALSEN19Parser__ppifstate_t1B(false, &state_1);
               }
            }
            FX_CALL(_fx_M6ParserFM2hdT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_4, &v_23, 0),
               _fx_catch_8);
            _fx_R10Ast__loc_t v_26 = v_23.t1;
            _fx_T2N19Parser__ppifstate_tR10Ast__loc_t v_27 = { state_1, v_26 };
            FX_CALL(_fx_cons_LT2N19Parser__ppifstate_tR10Ast__loc_t(&v_27, ppstack_2, true, &v_24), _fx_catch_8);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_4, &ts_1);
            FX_FREE_LIST_SIMPLE(&ppstack_1);
            FX_COPY_PTR(v_24, &ppstack_1);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
            FX_COPY_PTR(result_3, &result_2);

         _fx_catch_8: ;
            FX_FREE_LIST_SIMPLE(&v_24);
            _fx_free_T2N14Lexer__token_tR10Ast__loc_t(&v_23);
            if (v_22) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_22);
            }
            _fx_free_N15Parser__ppval_t(&x_1);
            if (ts_4) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_4);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_21);
            if (v_20) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_20);
            }
            goto _fx_endmatch_11;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 98) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_28 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_29 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_5 = 0;
            _fx_N15Parser__ppval_t x_2 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_30 = 0;
            _fx_T2N14Lexer__token_tR10Ast__loc_t v_31 = {0};
            _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t v_32 = 0;
            _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t v_33 = 0;
            bool process_elif_0;
            if (parent_process_0) {
               if (ppstack_2 != 0) {
                  _fx_N19Parser__ppifstate_t* v_34 = &ppstack_2->hd.t0;
                  if (v_34->tag == 2) {
                     if (v_34->u.PP_BR_FALSE == false) {
                        process_elif_0 = true; goto _fx_endmatch_9;
                     }
                  }
               }
               if (ppstack_2 != 0) {
                  if (ppstack_2->hd.t0.tag == 3) {
                     fx_exn_t v_35 = {0};
                     fx_str_t slit_4 = FX_MAKE_STR("@ELIF may not follow @ELSE (missing @ENDIF?)");
                     FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &slit_4, &v_35, 0), _fx_catch_9);
                     FX_THROW(&v_35, true, _fx_catch_9);

                  _fx_catch_9: ;
                     fx_free_exn(&v_35);
                     goto _fx_endmatch_9;
                  }
               }
               if (ppstack_2 == 0) {
                  fx_exn_t v_36 = {0};
                  fx_str_t slit_5 = FX_MAKE_STR("@ELIF occurs without preceeding @IF");
                  FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &slit_5, &v_36, 0), _fx_catch_10);
                  FX_THROW(&v_36, true, _fx_catch_10);

               _fx_catch_10: ;
                  fx_free_exn(&v_36);
                  goto _fx_endmatch_9;
               }
               process_elif_0 = false;

            _fx_endmatch_9: ;
               FX_CHECK_EXN(_fx_catch_11);
            }
            else {
               process_elif_0 = false;
            }
            FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_28, 0),
               _fx_catch_11);
            FX_CALL(
               _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                  v_28, process_elif_0, env_ref_0, &v_29, 0), _fx_catch_11);
            FX_COPY_PTR(v_29.t0, &ts_5);
            _fx_copy_N15Parser__ppval_t(&v_29.t1, &x_2);
            _fx_N19Parser__ppifstate_t state_2;
            if (!process_elif_0) {
               _fx_M6ParserFM11PP_BR_FALSEN19Parser__ppifstate_t1B(true, &state_2);
            }
            else {
               FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_5, &v_30, 0),
                  _fx_catch_11);
               bool v_37;
               FX_CALL(_fx_M6ParserFM11pp_get_boolB2N15Parser__ppval_tLT2N14Lexer__token_tR10Ast__loc_t(&x_2, v_30, &v_37, 0),
                  _fx_catch_11);
               if (v_37) {
                  state_2 = _fx_g18Parser__PP_BR_TRUE;
               }
               else {
                  _fx_M6ParserFM11PP_BR_FALSEN19Parser__ppifstate_t1B(false, &state_2);
               }
            }
            FX_CALL(_fx_M6ParserFM2hdT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_5, &v_31, 0),
               _fx_catch_11);
            _fx_R10Ast__loc_t v_38 = v_31.t1;
            _fx_T2N19Parser__ppifstate_tR10Ast__loc_t v_39 = { state_2, v_38 };
            FX_CALL(
               _fx_M6ParserFM2tlLT2N19Parser__ppifstate_tR10Ast__loc_t1LT2N19Parser__ppifstate_tR10Ast__loc_t(ppstack_2, &v_32,
                  0), _fx_catch_11);
            FX_CALL(_fx_cons_LT2N19Parser__ppifstate_tR10Ast__loc_t(&v_39, v_32, true, &v_33), _fx_catch_11);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(ts_5, &ts_1);
            FX_FREE_LIST_SIMPLE(&ppstack_1);
            FX_COPY_PTR(v_33, &ppstack_1);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
            FX_COPY_PTR(result_3, &result_2);

         _fx_catch_11: ;
            FX_FREE_LIST_SIMPLE(&v_33);
            FX_FREE_LIST_SIMPLE(&v_32);
            _fx_free_T2N14Lexer__token_tR10Ast__loc_t(&v_31);
            if (v_30) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_30);
            }
            _fx_free_N15Parser__ppval_t(&x_2);
            if (ts_5) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_5);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_29);
            if (v_28) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_28);
            }
            goto _fx_endmatch_11;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 99) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_40 = 0;
            _fx_T2N14Lexer__token_tR10Ast__loc_t v_41 = {0};
            _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t v_42 = 0;
            _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t v_43 = 0;
            bool process_else_0;
            if (parent_process_0) {
               if (ppstack_2 != 0) {
                  _fx_N19Parser__ppifstate_t* v_44 = &ppstack_2->hd.t0;
                  if (v_44->tag == 2) {
                     if (v_44->u.PP_BR_FALSE == false) {
                        process_else_0 = true; goto _fx_endmatch_10;
                     }
                  }
               }
               if (ppstack_2 != 0) {
                  if (ppstack_2->hd.t0.tag == 3) {
                     fx_exn_t v_45 = {0};
                     fx_str_t slit_6 = FX_MAKE_STR("@ELSE may not follow @ELSE (missing @ENDIF?)");
                     FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &slit_6, &v_45, 0), _fx_catch_12);
                     FX_THROW(&v_45, true, _fx_catch_12);

                  _fx_catch_12: ;
                     fx_free_exn(&v_45);
                     goto _fx_endmatch_10;
                  }
               }
               if (ppstack_2 == 0) {
                  fx_exn_t v_46 = {0};
                  fx_str_t slit_7 = FX_MAKE_STR("@ELSE occurs without preceeding @IF");
                  FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &slit_7, &v_46, 0), _fx_catch_13);
                  FX_THROW(&v_46, true, _fx_catch_13);

               _fx_catch_13: ;
                  fx_free_exn(&v_46);
                  goto _fx_endmatch_10;
               }
               process_else_0 = false;

            _fx_endmatch_10: ;
               FX_CHECK_EXN(_fx_catch_14);
            }
            else {
               process_else_0 = false;
            }
            _fx_N19Parser__ppifstate_t state_3;
            _fx_M6ParserFM10PP_BR_ELSEN19Parser__ppifstate_t1B(process_else_0, &state_3);
            FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_40, 0),
               _fx_catch_14);
            FX_CALL(_fx_M6ParserFM2hdT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_41, 0),
               _fx_catch_14);
            _fx_R10Ast__loc_t v_47 = v_41.t1;
            _fx_T2N19Parser__ppifstate_tR10Ast__loc_t v_48 = { state_3, v_47 };
            FX_CALL(
               _fx_M6ParserFM2tlLT2N19Parser__ppifstate_tR10Ast__loc_t1LT2N19Parser__ppifstate_tR10Ast__loc_t(ppstack_2, &v_42,
                  0), _fx_catch_14);
            FX_CALL(_fx_cons_LT2N19Parser__ppifstate_tR10Ast__loc_t(&v_48, v_42, true, &v_43), _fx_catch_14);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(v_40, &ts_1);
            FX_FREE_LIST_SIMPLE(&ppstack_1);
            FX_COPY_PTR(v_43, &ppstack_1);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
            FX_COPY_PTR(result_3, &result_2);

         _fx_catch_14: ;
            FX_FREE_LIST_SIMPLE(&v_43);
            FX_FREE_LIST_SIMPLE(&v_42);
            _fx_free_T2N14Lexer__token_tR10Ast__loc_t(&v_41);
            if (v_40) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_40);
            }
            goto _fx_endmatch_11;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 100) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_49 = 0;
            _fx_LT2N19Parser__ppifstate_tR10Ast__loc_t v_50 = 0;
            if (ppstack_2 == 0) {
               fx_exn_t v_51 = {0};
               fx_str_t slit_8 = FX_MAKE_STR("@ENDIF occurs without the matching @IF");
               FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &slit_8, &v_51, 0), _fx_catch_15);
               FX_THROW(&v_51, true, _fx_catch_15);

            _fx_catch_15: ;
               fx_free_exn(&v_51);
            }
            FX_CHECK_EXN(_fx_catch_16);
            FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_49, 0),
               _fx_catch_16);
            FX_CALL(
               _fx_M6ParserFM2tlLT2N19Parser__ppifstate_tR10Ast__loc_t1LT2N19Parser__ppifstate_tR10Ast__loc_t(ppstack_2, &v_50,
                  0), _fx_catch_16);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(v_49, &ts_1);
            FX_FREE_LIST_SIMPLE(&ppstack_1);
            FX_COPY_PTR(v_50, &ppstack_1);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
            FX_COPY_PTR(result_3, &result_2);

         _fx_catch_16: ;
            FX_FREE_LIST_SIMPLE(&v_50);
            if (v_49) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_49);
            }
            goto _fx_endmatch_11;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 103) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_52 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_53 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t next_ts_0 = 0;
            _fx_N15Parser__ppval_t x_3 = {0};
            fx_str_t msg_0 = {0};
            fx_exn_t v_54 = {0};
            FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_52, 0),
               _fx_catch_17);
            FX_CALL(
               _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                  v_52, process_0, env_ref_0, &v_53, 0), _fx_catch_17);
            FX_COPY_PTR(v_53.t0, &next_ts_0);
            _fx_copy_N15Parser__ppval_t(&v_53.t1, &x_3);
            if (process_0) {
               if (x_3.tag == 3) {
                  fx_copy_str(&x_3.u.PP_STRING, &msg_0);
               }
               else {
                  fx_str_t slit_9 = FX_MAKE_STR("@ERROR argument must be a string"); fx_copy_str(&slit_9, &msg_0);
               }
               FX_CHECK_EXN(_fx_catch_17);
               FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &msg_0, &v_54, 0), _fx_catch_17);
               FX_THROW(&v_54, true, _fx_catch_17);
            }
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(next_ts_0, &ts_1);
            FX_FREE_LIST_SIMPLE(&ppstack_1);
            FX_COPY_PTR(ppstack_2, &ppstack_1);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
            FX_COPY_PTR(result_3, &result_2);

         _fx_catch_17: ;
            fx_free_exn(&v_54);
            FX_FREE_STR(&msg_0);
            _fx_free_N15Parser__ppval_t(&x_3);
            if (next_ts_0) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&next_ts_0);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_53);
            if (v_52) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_52);
            }
            goto _fx_endmatch_11;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 104) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_55 = 0;
            _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_56 = {0};
            _fx_LT2N14Lexer__token_tR10Ast__loc_t next_ts_1 = 0;
            _fx_N15Parser__ppval_t x_4 = {0};
            fx_str_t msg_1 = {0};
            _fx_T2N14Lexer__token_tR10Ast__loc_t v_57 = {0};
            fx_str_t v_58 = {0};
            fx_str_t v_59 = {0};
            fx_str_t v_60 = {0};
            FX_CALL(_fx_M6ParserFM2tlLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_55, 0),
               _fx_catch_19);
            FX_CALL(
               _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                  v_55, process_0, env_ref_0, &v_56, 0), _fx_catch_19);
            FX_COPY_PTR(v_56.t0, &next_ts_1);
            _fx_copy_N15Parser__ppval_t(&v_56.t1, &x_4);
            if (process_0) {
               if (x_4.tag == 3) {
                  fx_copy_str(&x_4.u.PP_STRING, &msg_1);
               }
               else {
                  fx_exn_t v_61 = {0};
                  fx_str_t slit_10 = FX_MAKE_STR("@WARNING argument must be a string");
                  FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &slit_10, &v_61, 0), _fx_catch_18);
                  FX_THROW(&v_61, true, _fx_catch_18);

               _fx_catch_18: ;
                  fx_free_exn(&v_61);
               }
               FX_CHECK_EXN(_fx_catch_19);
               FX_CALL(_fx_M6ParserFM2hdT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(ts_2, &v_57, 0),
                  _fx_catch_19);
               _fx_R10Ast__loc_t v_62 = v_57.t1;
               FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(&v_62, &v_58, 0), _fx_catch_19);
               FX_CALL(_fx_M6ParserFM6stringS1S(&msg_1, &v_59, 0), _fx_catch_19);
               fx_str_t slit_11 = FX_MAKE_STR(": warning: ");
               {
                  const fx_str_t strs_1[] = { v_58, slit_11, v_59 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_60), _fx_catch_19);
               }
               FX_CALL(_fx_M6ParserFM7printlnv1S(&v_60, 0), _fx_catch_19);
            }
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
            FX_COPY_PTR(next_ts_1, &ts_1);
            FX_FREE_LIST_SIMPLE(&ppstack_1);
            FX_COPY_PTR(ppstack_2, &ppstack_1);
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
            FX_COPY_PTR(result_3, &result_2);

         _fx_catch_19: ;
            FX_FREE_STR(&v_60);
            FX_FREE_STR(&v_59);
            FX_FREE_STR(&v_58);
            _fx_free_T2N14Lexer__token_tR10Ast__loc_t(&v_57);
            FX_FREE_STR(&msg_1);
            _fx_free_N15Parser__ppval_t(&x_4);
            if (next_ts_1) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&next_ts_1);
            }
            _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_56);
            if (v_55) {
               _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_55);
            }
            goto _fx_endmatch_11;
         }
      }
      if (ts_2 != 0) {
         if (ts_2->hd.t0.tag == 6) {
            _fx_LT2N14Lexer__token_tR10Ast__loc_t v_63 = ts_2->tl;
            if (v_63 != 0) {
               _fx_T2N14Lexer__token_tR10Ast__loc_t* v_64 = &v_63->hd;
               if (v_64->t0.tag == 49) {
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_65 = {0};
                  _fx_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t v_66 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t ts_6 = 0;
                  _fx_N15Parser__ppval_t x_5 = {0};
                  _fx_LT2N14Lexer__token_tR10Ast__loc_t result_4 = 0;
                  _fx_N14Lexer__token_t t_0 = {0};
                  _fx_T2N14Lexer__token_tR10Ast__loc_t v_67 = {0};
                  _fx_R10Ast__loc_t* l1_0 = &v_64->t1;
                  FX_CALL(
                     _fx_M6ParserFM6pp_expT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3LT2N14Lexer__token_tR10Ast__loc_tBrNt10Hashmap__t2SN15Parser__ppval_t(
                        v_63->tl, process_0, env_ref_0, &v_65, 0), _fx_catch_20);
                  FX_CALL(
                     _fx_M6ParserFM14pp_match_parenT2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t3T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_tN14Lexer__token_tR10Ast__loc_t(
                        &v_65, &_fx_g14Parser__RBRACE, l1_0, &v_66, 0), _fx_catch_20);
                  FX_COPY_PTR(v_66.t0, &ts_6);
                  _fx_copy_N15Parser__ppval_t(&v_66.t1, &x_5);
                  if (process_0) {
                     int tag_0 = x_5.tag;
                     if (tag_0 == 1) {
                        _fx_N10Ast__lit_t v_68 = {0};
                        _fx_M3AstFM6LitIntN10Ast__lit_t1l(x_5.u.PP_INT, &v_68);
                        _fx_M5LexerFM7LITERALN14Lexer__token_t1N10Ast__lit_t(&v_68, &t_0);
                        _fx_free_N10Ast__lit_t(&v_68);
                     }
                     else if (tag_0 == 2) {
                        _fx_N10Ast__lit_t v_69 = {0};
                        _fx_M3AstFM7LitBoolN10Ast__lit_t1B(x_5.u.PP_BOOL, &v_69);
                        _fx_M5LexerFM7LITERALN14Lexer__token_t1N10Ast__lit_t(&v_69, &t_0);
                        _fx_free_N10Ast__lit_t(&v_69);
                     }
                     else if (tag_0 == 3) {
                        _fx_N10Ast__lit_t v_70 = {0};
                        _fx_M3AstFM9LitStringN10Ast__lit_t1S(&x_5.u.PP_STRING, &v_70);
                        _fx_M5LexerFM7LITERALN14Lexer__token_t1N10Ast__lit_t(&v_70, &t_0);
                        _fx_free_N10Ast__lit_t(&v_70);
                     }
                     else {
                        FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_20);
                     }
                     FX_CHECK_EXN(_fx_catch_20);
                     _fx_make_T2N14Lexer__token_tR10Ast__loc_t(&t_0, l1_0, &v_67);
                     FX_CALL(_fx_cons_LT2N14Lexer__token_tR10Ast__loc_t(&v_67, result_3, true, &result_4), _fx_catch_20);
                  }
                  else {
                     FX_COPY_PTR(result_3, &result_4);
                  }
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
                  FX_COPY_PTR(ts_6, &ts_1);
                  FX_FREE_LIST_SIMPLE(&ppstack_1);
                  FX_COPY_PTR(ppstack_2, &ppstack_1);
                  _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
                  FX_COPY_PTR(result_4, &result_2);

               _fx_catch_20: ;
                  _fx_free_T2N14Lexer__token_tR10Ast__loc_t(&v_67);
                  _fx_free_N14Lexer__token_t(&t_0);
                  if (result_4) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_4);
                  }
                  _fx_free_N15Parser__ppval_t(&x_5);
                  if (ts_6) {
                     _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_6);
                  }
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_66);
                  _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tN15Parser__ppval_t(&v_65);
                  goto _fx_endmatch_11;
               }
            }
         }
      }
      if (ts_2 != 0) {
         _fx_LT2N14Lexer__token_tR10Ast__loc_t result_5 = 0;
         if (process_0) {
            FX_CALL(_fx_cons_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2->hd, result_3, true, &result_5), _fx_catch_21);
         }
         else {
            FX_COPY_PTR(result_3, &result_5);
         }
         _fx_LT2N14Lexer__token_tR10Ast__loc_t* rest_4 = &ts_2->tl;
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
         FX_COPY_PTR(*rest_4, &ts_1);
         FX_FREE_LIST_SIMPLE(&ppstack_1);
         FX_COPY_PTR(ppstack_2, &ppstack_1);
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
         FX_COPY_PTR(result_5, &result_2);

      _fx_catch_21: ;
         if (result_5) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_5);
         }
         goto _fx_endmatch_11;
      }
      _fx_LT2N14Lexer__token_tR10Ast__loc_t result_6 = 0;
      if (ppstack_2 != 0) {
         fx_str_t v_71 = {0};
         fx_str_t v_72 = {0};
         fx_exn_t v_73 = {0};
         FX_CALL(_fx_M3AstFM6stringS1RM5loc_t(&ppstack_2->hd.t1, &v_71, 0), _fx_catch_22);
         fx_str_t slit_12 = FX_MAKE_STR("@IF/ELIF/ELSE-block starting at ");
         fx_str_t slit_13 = FX_MAKE_STR(" is not terminated by @ENDIF");
         {
            const fx_str_t strs_2[] = { slit_12, v_71, slit_13 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_2, 3, &v_72), _fx_catch_22);
         }
         FX_CALL(_fx_M6ParserFM6pp_errE2LT2N14Lexer__token_tR10Ast__loc_tS(ts_2, &v_72, &v_73, 0), _fx_catch_22);
         FX_THROW(&v_73, true, _fx_catch_22);

      _fx_catch_22: ;
         fx_free_exn(&v_73);
         FX_FREE_STR(&v_72);
         FX_FREE_STR(&v_71);
      }
      FX_CHECK_EXN(_fx_catch_23);
      FX_CALL(_fx_M6ParserFM3revLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(result_3, &result_6, 0),
         _fx_catch_23);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_1);
      FX_COPY_PTR(result_6, &result_1);
      FX_BREAK(_fx_catch_23);

   _fx_catch_23: ;
      if (result_6) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_6);
      }

   _fx_endmatch_11: ;
      FX_CHECK_EXN(_fx_catch_24);

   _fx_catch_24: ;
      if (result_3) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_3);
      }
      FX_FREE_LIST_SIMPLE(&ppstack_2);
      if (ts_2) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(result_1, fx_result);

_fx_cleanup: ;
   if (result_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_1);
   }
   if (ts_1) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&ts_1);
   }
   FX_FREE_LIST_SIMPLE(&ppstack_1);
   if (result_2) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6ParserFM5parseB3iLN14Lexer__token_tLS(
   int_ m_idx_0,
   struct _fx_LN14Lexer__token_t_data_t* preamble_0,
   struct _fx_LS_data_t* inc_dirs_0,
   bool* fx_result,
   void* fx_fv)
{
   _fx_N16Ast__defmodule_t dm_0 = 0;
   fx_str_t v_0 = {0};
   fx_str_t v_1 = {0};
   _fx_R20Parser__parser_ctx_t v_2 = {0};
   _fx_N20LexerUtils__stream_t strm_0 = 0;
   fx_exn_t exn_0 = {0};
   _fx_FPLT2N14Lexer__token_tTa2i0 lexer_0 = {0};
   _fx_LT2N14Lexer__token_tR10Ast__loc_t all_tokens_0 = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t __fold_result___0 = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t v_3 = 0;
   _fx_LN14Lexer__token_t __fold_result___1 = 0;
   _fx_LN14Lexer__token_t v_4 = 0;
   _fx_LT2N14Lexer__token_tR10Ast__loc_t v_5 = 0;
   _fx_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t v_6 = {0};
   _fx_LN10Ast__exp_t v_7 = 0;
   _fx_Li v_8 = 0;
   _fx_Li __fold_result___2 = 0;
   _fx_Li v_9 = 0;
   int fx_status = 0;
   FX_CHKIDX(FX_CHKIDX1(_fx_g16Ast__all_modules, 0, m_idx_0), _fx_cleanup);
   FX_COPY_PTR(*FX_PTR_1D(_fx_N16Ast__defmodule_t, _fx_g16Ast__all_modules, m_idx_0), &dm_0);
   fx_copy_str(&dm_0->u.defmodule_t.t1, &v_0);
   _fx_R9Ast__id_t fname_id_0;
   FX_CALL(_fx_M3AstFM6get_idRM4id_t1S(&v_0, &fname_id_0, 0), _fx_cleanup);
   fx_copy_str(&dm_0->u.defmodule_t.t1, &v_1);
   _fx_R10Ast__loc_t v_10 = { dm_0->u.defmodule_t.t2, 1, 1, 1, 1 };
   _fx_make_R20Parser__parser_ctx_t(dm_0->u.defmodule_t.t2, &v_1, 0, inc_dirs_0, &v_10, &v_2);
   _fx_free_R20Parser__parser_ctx_t(&_fx_g18Parser__parser_ctx);
   _fx_copy_R20Parser__parser_ctx_t(&v_2, &_fx_g18Parser__parser_ctx);
   dm_0->u.defmodule_t.t7 = true;
   FX_CHKIDX(FX_CHKIDX1(_fx_g16Ast__all_modules, 0, m_idx_0), _fx_cleanup);
   (*FX_PTR_1D(_fx_N16Ast__defmodule_t, _fx_g16Ast__all_modules, m_idx_0))->u.defmodule_t.t7 = true;
   fx_str_t v_11 = {0};
   fx_copy_str(&dm_0->u.defmodule_t.t1, &v_11);
   FX_CALL(_fx_M10LexerUtilsFM11make_streamN20LexerUtils__stream_t1S(&v_11, &strm_0, 0), _fx_catch_0);

_fx_catch_0: ;
   FX_FREE_STR(&v_11);
   if (fx_status < 0) {
      fx_exn_get_and_reset(fx_status, &exn_0);
      fx_status = 0;
      if (strm_0) {
         _fx_free_N20LexerUtils__stream_t(&strm_0);
      }
      int tag_0 = exn_0.tag;
      if (tag_0 == FX_EXN_FileOpenError) {
         fx_exn_t v_12 = {0};
         _fx_R10Ast__loc_t v_13 = _fx_g18Parser__parser_ctx.default_loc;
         fx_str_t slit_0 = FX_MAKE_STR("cannot open file");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&v_13, &slit_0, &v_12), _fx_catch_1);
         FX_THROW(&v_12, true, _fx_catch_1);

      _fx_catch_1: ;
         fx_free_exn(&v_12);
      }
      else if (tag_0 == FX_EXN_IOError) {
         fx_exn_t v_14 = {0};
         _fx_R10Ast__loc_t v_15 = _fx_g18Parser__parser_ctx.default_loc;
         fx_str_t slit_1 = FX_MAKE_STR("cannot read file");
         FX_CALL(_fx_M6ParserFM15make_ParseErrorE2R10Ast__loc_tS(&v_15, &slit_1, &v_14), _fx_catch_2);
         FX_THROW(&v_14, true, _fx_catch_2);

      _fx_catch_2: ;
         fx_free_exn(&v_14);
      }
      else {
         FX_RETHROW(&exn_0, _fx_cleanup);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_CALL(_fx_M5LexerFM10make_lexerFPLT2N14Lexer__token_tTa2i01N20LexerUtils__stream_t(strm_0, &lexer_0, 0), _fx_cleanup);
   int_ prev_lineno_0 = -1;
   for (;;) {
      _fx_LT2N14Lexer__token_tTa2i more_tokens_0 = 0;
      _fx_LT2N14Lexer__token_tR10Ast__loc_t all_tokens_1 = 0;
      FX_CALL(lexer_0.fp(&more_tokens_0, lexer_0.fcv), _fx_catch_5);
      _fx_LT2N14Lexer__token_tTa2i lst_0 = more_tokens_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_N14Lexer__token_t t_0 = {0};
         fx_str_t v_16 = {0};
         fx_str_t v_17 = {0};
         fx_str_t v_18 = {0};
         _fx_Ta2S v_19 = {0};
         fx_str_t v_20 = {0};
         fx_str_t v_21 = {0};
         _fx_T2N14Lexer__token_tR10Ast__loc_t v_22 = {0};
         _fx_LT2N14Lexer__token_tR10Ast__loc_t v_23 = 0;
         _fx_T2N14Lexer__token_tTa2i* __pat___0 = &lst_0->hd;
         _fx_copy_N14Lexer__token_t(&__pat___0->t0, &t_0);
         _fx_Ta2i* i_0 = &__pat___0->t1;
         int_ lineno_0 = i_0->t0;
         int_ col_0 = i_0->t1;
         _fx_R10Ast__loc_t loc_0 = { dm_0->u.defmodule_t.t2, lineno_0, col_0, lineno_0, col_0 };
         if (_fx_g12Options__opt.print_tokens) {
            if (lineno_0 != prev_lineno_0) {
               FX_CALL(_fx_M3AstFM2ppS1RM4id_t(&fname_id_0, &v_16, 0), _fx_catch_3);
               FX_CALL(_fx_F6stringS1i(lineno_0, &v_17, 0), _fx_catch_3);
               fx_str_t slit_2 = FX_MAKE_STR("\n");
               fx_str_t slit_3 = FX_MAKE_STR(":");
               fx_str_t slit_4 = FX_MAKE_STR(": ");
               {
                  const fx_str_t strs_0[] = { slit_2, v_16, slit_3, v_17, slit_4 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_0, 5, &v_18), _fx_catch_3);
               }
               _fx_F12print_stringv1S(&v_18, 0);
               prev_lineno_0 = lineno_0;
            }
            FX_CALL(_fx_M5LexerFM7tok2strTa2S1N14Lexer__token_t(&t_0, &v_19, 0), _fx_catch_3);
            fx_copy_str(&v_19.t0, &v_20);
            fx_str_t slit_5 = FX_MAKE_STR(" ");
            {
               const fx_str_t strs_1[] = { v_20, slit_5 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_1, 2, &v_21), _fx_catch_3);
            }
            _fx_F12print_stringv1S(&v_21, 0);
         }
         _fx_make_T2N14Lexer__token_tR10Ast__loc_t(&t_0, &loc_0, &v_22);
         FX_CALL(_fx_cons_LT2N14Lexer__token_tR10Ast__loc_t(&v_22, all_tokens_0, true, &v_23), _fx_catch_3);
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&all_tokens_0);
         FX_COPY_PTR(v_23, &all_tokens_0);

      _fx_catch_3: ;
         if (v_23) {
            _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_23);
         }
         _fx_free_T2N14Lexer__token_tR10Ast__loc_t(&v_22);
         FX_FREE_STR(&v_21);
         FX_FREE_STR(&v_20);
         _fx_free_Ta2S(&v_19);
         FX_FREE_STR(&v_18);
         FX_FREE_STR(&v_17);
         FX_FREE_STR(&v_16);
         _fx_free_N14Lexer__token_t(&t_0);
         FX_CHECK_EXN(_fx_catch_5);
      }
      FX_COPY_PTR(all_tokens_0, &all_tokens_1);
      if (all_tokens_1 != 0) {
         if (all_tokens_1->hd.t0.tag == 63) {
            FX_BREAK(_fx_catch_4);  _fx_catch_4: ; goto _fx_endmatch_0;
         }
      }

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_5);

   _fx_catch_5: ;
      if (all_tokens_1) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&all_tokens_1);
      }
      if (more_tokens_0) {
         _fx_free_LT2N14Lexer__token_tTa2i(&more_tokens_0);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_LT2N14Lexer__token_tR10Ast__loc_t lst_1 = all_tokens_0;
   for (; lst_1; lst_1 = lst_1->tl) {
      _fx_LT2N14Lexer__token_tR10Ast__loc_t r_0 = 0;
      _fx_T2N14Lexer__token_tR10Ast__loc_t* a_0 = &lst_1->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LT2N14Lexer__token_tR10Ast__loc_t(a_0, r_0, false, &r_0), _fx_catch_6);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_6: ;
      if (r_0) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, &v_3);
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&all_tokens_0);
   FX_COPY_PTR(v_3, &all_tokens_0);
   _fx_LN14Lexer__token_t lst_2 = preamble_0;
   for (; lst_2; lst_2 = lst_2->tl) {
      _fx_LN14Lexer__token_t r_1 = 0;
      _fx_N14Lexer__token_t* a_1 = &lst_2->hd;
      FX_COPY_PTR(__fold_result___1, &r_1);
      FX_CALL(_fx_cons_LN14Lexer__token_t(a_1, r_1, false, &r_1), _fx_catch_7);
      _fx_free_LN14Lexer__token_t(&__fold_result___1);
      FX_COPY_PTR(r_1, &__fold_result___1);

   _fx_catch_7: ;
      if (r_1) {
         _fx_free_LN14Lexer__token_t(&r_1);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___1, &v_4);
   _fx_LN14Lexer__token_t lst_3 = v_4;
   for (; lst_3; lst_3 = lst_3->tl) {
      _fx_T2N14Lexer__token_tR10Ast__loc_t v_24 = {0};
      _fx_LT2N14Lexer__token_tR10Ast__loc_t v_25 = 0;
      _fx_N14Lexer__token_t* t_1 = &lst_3->hd;
      _fx_R10Ast__loc_t v_26 = _fx_g18Parser__parser_ctx.default_loc;
      _fx_make_T2N14Lexer__token_tR10Ast__loc_t(t_1, &v_26, &v_24);
      FX_CALL(_fx_cons_LT2N14Lexer__token_tR10Ast__loc_t(&v_24, all_tokens_0, true, &v_25), _fx_catch_8);
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&all_tokens_0);
      FX_COPY_PTR(v_25, &all_tokens_0);

   _fx_catch_8: ;
      if (v_25) {
         _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_25);
      }
      _fx_free_T2N14Lexer__token_tR10Ast__loc_t(&v_24);
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_CALL(_fx_M6ParserFM10preprocessLT2N14Lexer__token_tR10Ast__loc_t1LT2N14Lexer__token_tR10Ast__loc_t(all_tokens_0, &v_5, 0),
      _fx_cleanup);
   _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&all_tokens_0);
   FX_COPY_PTR(v_5, &all_tokens_0);
   FX_CALL(
      _fx_M6ParserFM12parse_expseqT2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t2LT2N14Lexer__token_tR10Ast__loc_tB(
         all_tokens_0, true, &v_6, 0), _fx_cleanup);
   FX_COPY_PTR(v_6.t1, &v_7);
   _fx_LN10Ast__exp_t* v_27 = &dm_0->u.defmodule_t.t4;
   _fx_free_LN10Ast__exp_t(v_27);
   FX_COPY_PTR(v_7, v_27);
   FX_COPY_PTR(_fx_g18Parser__parser_ctx.deps, &v_8);
   _fx_Li lst_4 = v_8;
   for (; lst_4; lst_4 = lst_4->tl) {
      _fx_Li r_2 = 0;
      int_ a_2 = lst_4->hd;
      FX_COPY_PTR(__fold_result___2, &r_2);
      FX_CALL(_fx_cons_Li(a_2, r_2, false, &r_2), _fx_catch_9);
      FX_FREE_LIST_SIMPLE(&__fold_result___2);
      FX_COPY_PTR(r_2, &__fold_result___2);

   _fx_catch_9: ;
      FX_FREE_LIST_SIMPLE(&r_2);
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___2, &v_9);
   _fx_Li* v_28 = &dm_0->u.defmodule_t.t5;
   FX_FREE_LIST_SIMPLE(v_28);
   FX_COPY_PTR(v_9, v_28);
   FX_CHKIDX(FX_CHKIDX1(_fx_g16Ast__all_modules, 0, m_idx_0), _fx_cleanup);
   _fx_N16Ast__defmodule_t* v_29 = FX_PTR_1D(_fx_N16Ast__defmodule_t, _fx_g16Ast__all_modules, m_idx_0);
   _fx_free_N16Ast__defmodule_t(v_29);
   FX_COPY_PTR(dm_0, v_29);
   *fx_result = true;

_fx_cleanup: ;
   if (dm_0) {
      _fx_free_N16Ast__defmodule_t(&dm_0);
   }
   FX_FREE_STR(&v_0);
   FX_FREE_STR(&v_1);
   _fx_free_R20Parser__parser_ctx_t(&v_2);
   if (strm_0) {
      _fx_free_N20LexerUtils__stream_t(&strm_0);
   }
   fx_free_exn(&exn_0);
   FX_FREE_FP(&lexer_0);
   if (all_tokens_0) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&all_tokens_0);
   }
   if (__fold_result___0) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&__fold_result___0);
   }
   if (v_3) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_3);
   }
   if (__fold_result___1) {
      _fx_free_LN14Lexer__token_t(&__fold_result___1);
   }
   if (v_4) {
      _fx_free_LN14Lexer__token_t(&v_4);
   }
   if (v_5) {
      _fx_free_LT2N14Lexer__token_tR10Ast__loc_t(&v_5);
   }
   _fx_free_T2LT2N14Lexer__token_tR10Ast__loc_tLN10Ast__exp_t(&v_6);
   if (v_7) {
      _fx_free_LN10Ast__exp_t(&v_7);
   }
   FX_FREE_LIST_SIMPLE(&v_8);
   FX_FREE_LIST_SIMPLE(&__fold_result___2);
   FX_FREE_LIST_SIMPLE(&v_9);
   return fx_status;
}

FX_EXTERN_C int fx_init_Parser(void)
{
   FX_REG_EXN("Parser.ParseError", _FX_EXN_E18Parser__ParseError, _fx_E18Parser__ParseError_info,
      _fx_free_E18Parser__ParseError);
   int fx_status = 0;
   fx_str_t slit_0 = FX_MAKE_STR("");
   _fx_make_R20Parser__parser_ctx_t(-1, &slit_0, 0, 0, &_fx_g10Ast__noloc, &_fx_g18Parser__parser_ctx);
   return fx_status;
}

FX_EXTERN_C void fx_deinit_Parser(void)
{
   _fx_free_R20Parser__parser_ctx_t(&_fx_g18Parser__parser_ctx);
}

